aboutsummaryrefslogtreecommitdiff
path: root/msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'msg.c')
-rw-r--r--msg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/msg.c b/msg.c
index 010f508..4be1243 100644
--- a/msg.c
+++ b/msg.c
@@ -183,7 +183,8 @@ handle_file(const char *path)
asprintf(&outpath, "%s/%s", OUTPUT, path);
}
- char *directory = dirname(strdup(outpath));
+ char *temp_outpath = strdup(outpath);
+ char *directory = dirname(temp_outpath);
char *next = calloc(strlen(directory) + 1, sizeof(char));
strcpy(next, "");
@@ -198,6 +199,9 @@ handle_file(const char *path)
mkdir(next, 0700);
}
+ free(next);
+ free(temp_outpath);
+
FILE *in = fopen(inpath, "r");
FILE *out = fopen(outpath, "w");