Browse Source

Merge branch 'bugfix_cfgwrite_fnleak' into bfgminer-2.8.x

Conflicts:
	cgminer.c
Luke Dashjr 13 years ago
parent
commit
c0dd7b2f6d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      miner.c

+ 3 - 0
miner.c

@@ -4495,6 +4495,7 @@ retry:
 			struct stat statbuf;
 			struct stat statbuf;
 
 
 			strcpy(filename, str);
 			strcpy(filename, str);
+			free(str);
 			if (!stat(filename, &statbuf)) {
 			if (!stat(filename, &statbuf)) {
 				wlogprint("File exists, overwrite?\n");
 				wlogprint("File exists, overwrite?\n");
 				input = getch();
 				input = getch();
@@ -4502,6 +4503,8 @@ retry:
 					goto retry;
 					goto retry;
 			}
 			}
 		}
 		}
+		else
+			free(str);
 		fcfg = fopen(filename, "w");
 		fcfg = fopen(filename, "w");
 		if (!fcfg) {
 		if (!fcfg) {
 			wlogprint("Cannot open or create file\n");
 			wlogprint("Cannot open or create file\n");