Browse Source

Merge pull request #375 from luke-jr/bugfix_cfgwrite_fnleak

Free filename entry for writing config file when done with it
nfactor-troky
Con Kolivas 12 years ago
parent
commit
5c32a47b96
  1. 3
      cgminer.c

3
cgminer.c

@ -4324,6 +4324,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();
@ -4331,6 +4332,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");

Loading…
Cancel
Save