mirror of
https://git.zap.org.au/git/trader.git
synced 2024-12-04 14:46:45 -05:00
Bug fix: resolve memory leakage for the filename variable
This commit is contained in:
parent
593cda9a97
commit
91d77f002c
@ -552,6 +552,7 @@ bool load_game (int num)
|
||||
}
|
||||
|
||||
free(buf);
|
||||
free(filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -640,6 +641,7 @@ bool load_game (int num)
|
||||
}
|
||||
|
||||
free(buf);
|
||||
free(filename);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -723,6 +725,7 @@ bool save_game (int num)
|
||||
deltxwin();
|
||||
|
||||
free(buf);
|
||||
free(filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -783,6 +786,7 @@ bool save_game (int num)
|
||||
}
|
||||
|
||||
free(buf);
|
||||
free(filename);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user