Fix memory leak in _client_motdw3() when returning without calling xfree() on variable 'filename'
This commit is contained in:
parent
6f3cd20c47
commit
daee1995f9
1 changed files with 2 additions and 2 deletions
|
@ -2791,11 +2791,10 @@ namespace pvpgn
|
|||
|
||||
|
||||
// read text from bnmotd_w3.txt
|
||||
char const * filename;
|
||||
char * buff, *line;
|
||||
std::FILE * fp;
|
||||
|
||||
filename = i18n_filename(prefs_get_motdw3file(), conn_get_gamelang_localized(c));
|
||||
const char* const filename = i18n_filename(prefs_get_motdw3file(), conn_get_gamelang_localized(c));
|
||||
|
||||
if (fp = std::fopen(filename, "r"))
|
||||
{
|
||||
|
@ -2813,6 +2812,7 @@ namespace pvpgn
|
|||
|
||||
conn_push_outqueue(c, rpacket);
|
||||
packet_del_ref(rpacket);
|
||||
xfree((void*)filename);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue