aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-01-07 09:35:57 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-01-07 09:35:57 +0000
commit0f34521612456d844959b1ef0ad5555d1821b67d (patch)
tree30e8be0c8d623a8dbdcae6b271063e57e948f44b /src
parente69362df2291f0f692af027f4a455415aeb7030f (diff)
fixed the create_dir_hierarchy() to not use uninited memory, as noticed by
Matthew Blain.
Diffstat (limited to 'src')
-rw-r--r--src/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 992c3413c..813bf49cc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3054,6 +3054,9 @@ static int create_dir_hierarchy(char *outfile)
outdup = strdup(outfile);
dirbuildup = malloc(sizeof(char) * strlen(outfile));
+ if(!dirbuildup)
+ return -1;
+ dirbuildup[0] = '\0';
tempdir = strtok(outdup, DIR_CHAR);