summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLuke Bratch <luke@bratch.co.uk>2019-05-18 22:56:46 +0100
committerLuke Bratch <luke@bratch.co.uk>2019-05-18 22:56:46 +0100
commitc15a7d4513b51ebd668ced49eb7934a1be748851 (patch)
tree25ffdca479b13e4816a28c4b45b1d8210b22ac0c /config.c
parent7764645c80ed542095b97eaa119d2df6340b0330 (diff)
Avoid memory leak when creating default configuration file.
Diffstat (limited to 'config.c')
-rw-r--r--config.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/config.c b/config.c
index 2f790a5..1473a1e 100644
--- a/config.c
+++ b/config.c
@@ -148,7 +148,6 @@ int createconfigfile(char *filename) {
}
FILE *fp;
-// char line[MAXCHAR];
fp = fopen(filename, "a");
@@ -220,7 +219,7 @@ int createconfigfile(char *filename) {
}
fclose(fp);
+ free(dirtmp);
+ free(dir);
return 0;
-
-exit(1);
}