]> granicus.if.org Git - curl/commitdiff
fixed the create_dir_hierarchy() to not use uninited memory, as noticed by
authorDaniel Stenberg <daniel@haxx.se>
Tue, 7 Jan 2003 09:35:57 +0000 (09:35 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 7 Jan 2003 09:35:57 +0000 (09:35 +0000)
Matthew Blain.

src/main.c

index 992c3413ca615c939f46024429e8e0f36b54e6f2..813bf49cc496bf39991b133d212ebff186f3188d 100644 (file)
@@ -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);