mirror of
https://github.com/curl/curl.git
synced 2026-07-24 12:27:16 +03:00
fix memory leak in case of memory problems
CID 16 by coverity.com scan
This commit is contained in:
parent
dc2ea33e32
commit
5796c7b132
1 changed files with 7 additions and 2 deletions
|
|
@ -4671,9 +4671,14 @@ static int create_dir_hierarchy(const char *outfile)
|
|||
int error;
|
||||
|
||||
outdup = strdup(outfile);
|
||||
dirbuildup = malloc(sizeof(char) * strlen(outfile));
|
||||
if(!dirbuildup)
|
||||
if(!outdup)
|
||||
return -1;
|
||||
|
||||
dirbuildup = malloc(sizeof(char) * strlen(outfile));
|
||||
if(!dirbuildup) {
|
||||
free(outdup);
|
||||
return -1;
|
||||
}
|
||||
dirbuildup[0] = '\0';
|
||||
|
||||
tempdir = strtok(outdup, DIR_CHAR);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue