mirror of
https://github.com/GOSTSec/sgminer
synced 2025-02-02 10:04:33 +00:00
Merge pull request #375 from luke-jr/bugfix_cfgwrite_fnleak
Free filename entry for writing config file when done with it
This commit is contained in:
commit
5c32a47b96
@ -4324,6 +4324,7 @@ retry:
|
||||
struct stat statbuf;
|
||||
|
||||
strcpy(filename, str);
|
||||
free(str);
|
||||
if (!stat(filename, &statbuf)) {
|
||||
wlogprint("File exists, overwrite?\n");
|
||||
input = getch();
|
||||
@ -4331,6 +4332,8 @@ retry:
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
else
|
||||
free(str);
|
||||
fcfg = fopen(filename, "w");
|
||||
if (!fcfg) {
|
||||
wlogprint("Cannot open or create file\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user