Fix memory leak in Strife related to finding voices.wad (fix #1118)

This commit is contained in:
mfrancis95 2018-12-08 20:56:01 -05:00
parent 2b20ce64a8
commit b9f75eb05e

View file

@ -858,7 +858,7 @@ void D_IdentifyVersion(void)
if(!M_FileExists(voiceswad)) if(!M_FileExists(voiceswad))
Z_Free(voiceswad); Z_Free(voiceswad);
else else
name = voiceswad; // STRIFE-FIXME: memory leak!! name = voiceswad;
} }
// not found? try global search paths // not found? try global search paths
@ -877,6 +877,7 @@ void D_IdentifyVersion(void)
{ {
// add it. // add it.
D_AddFile(name); D_AddFile(name);
p ? Z_Free(name) : free(name);
} }
} }
} }