summaryrefslogtreecommitdiff
path: root/poptparse.c
diff options
context:
space:
mode:
authorjbj <jbj>2007-07-13 12:24:00 +0000
committerjbj <jbj>2007-07-13 12:24:00 +0000
commite9bc946857348dff6c0833471afebebc0ee5077d (patch)
tree0b00e435b9c8fcf2faecbca8d996a1ec8b76966b /poptparse.c
parent79d3ff0eb8241e6dc2712d793c3a8de0cae67017 (diff)
downloadlibpopt-e9bc946857348dff6c0833471afebebc0ee5077d.tar.gz
plug another memory leak on an error retrun path.
Diffstat (limited to 'poptparse.c')
-rw-r--r--poptparse.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/poptparse.c b/poptparse.c
index 02c5baa..9064253 100644
--- a/poptparse.c
+++ b/poptparse.c
@@ -67,7 +67,10 @@ int poptParseArgvString(const char * s, int * argcPtr, const char *** argvPtr)
if (argv == NULL) return rc;
buf = bufOrig = calloc(1, buflen);
- if (buf == NULL) return rc;
+ if (buf == NULL) {
+ free(argv);
+ return rc;
+ }
argv[argc] = buf;
for (src = s; *src != '\0'; src++) {