aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.c7
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);