From: Daniel Stenberg Date: Tue, 7 Jan 2003 09:35:57 +0000 (+0000) Subject: fixed the create_dir_hierarchy() to not use uninited memory, as noticed by X-Git-Tag: curl-7_10_3~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f34521612456d844959b1ef0ad5555d1821b67d;p=curl fixed the create_dir_hierarchy() to not use uninited memory, as noticed by Matthew Blain. --- 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);