Skip to content

one memory leak and resource leak fixed, now the rest of them (4) #5

@GoogleCodeExporter

Description

@GoogleCodeExporter
diff -uBb strcollection.c.org strcollection.c
--- strcollection.c.org 2011-03-01 11:49:57.397800620 +0100
+++ strcollection.c 2011-03-01 11:54:29.966477540 +0100
@@ -1166,17 +1166,23 @@
        return NULL;
    }
    result = iStringCollection.Create(10);
-   if (result == NULL)
+   if (result == NULL) {
+       close(f);
        return NULL;
+   }
    r = GetLine(&line,&llen,f,mm);
    while (r >= 0) {
        if (iStringCollection.Add(result,line) <= 0) {
            Finalize(result);
+           free(line);
+           close(f);
            return NULL;
        }
        r = GetLine(&line,&llen,f,mm);
    }
    if (r != EOF) {
+       free(line);
+       close(f);
        Finalize(result);
        return NULL;
    }

Original issue reported on code.google.com by oetelaar.automatisering on 1 Mar 2011 at 10:56

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions