From 1a8fe32e4c4c5984085986b14a93650b6bd9b9c2 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 6 Dec 2012 19:11:01 +0000 Subject: [PATCH] Bugfix: Free filename entry for writing config file when done with it --- cgminer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cgminer.c b/cgminer.c index 12bb343e..74a3c0e6 100644 --- a/cgminer.c +++ b/cgminer.c @@ -2605,6 +2605,7 @@ retry: struct stat statbuf; strcpy(filename, str); + free(str); if (!stat(filename, &statbuf)) { wlogprint("File exists, overwrite?\n"); input = getch(); @@ -2612,6 +2613,8 @@ retry: goto retry; } } + else + free(str); fcfg = fopen(filename, "w"); if (!fcfg) { wlogprint("Cannot open or create file\n");