diff options
author | Daniel Stenberg <daniel@haxx.se> | 2007-03-31 21:20:16 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2007-03-31 21:20:16 +0000 |
commit | 5796c7b1322375da0fa15620ca1a9c825df0ab01 (patch) | |
tree | c6a66827a4293cb73e3b2e551af64e199a9fe0f5 /src | |
parent | dc2ea33e32ba9aeecdcd33c0541a9e33a85774ba (diff) |
fix memory leak in case of memory problems
CID 16 by coverity.com scan
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c index cfec4a307..5a953519d 100644 --- a/src/main.c +++ b/src/main.c @@ -4671,9 +4671,14 @@ static int create_dir_hierarchy(const char *outfile) int error; outdup = strdup(outfile); + if(!outdup) + return -1; + dirbuildup = malloc(sizeof(char) * strlen(outfile)); - if(!dirbuildup) + if(!dirbuildup) { + free(outdup); return -1; + } dirbuildup[0] = '\0'; tempdir = strtok(outdup, DIR_CHAR); |