Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Sep 2, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant