Skip to content

Commit

Permalink
Merge pull request #1119 from mfrancis95/master
Browse files Browse the repository at this point in the history
Fix memory leak in Strife related to finding voices.wad and make finding it case-insensitive
  • Loading branch information
fabiangreffrath committed Dec 12, 2018
2 parents 1b98fb5 + b18f464 commit 482d302
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/strife/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,8 @@ void D_IdentifyVersion(void)
voiceswad = M_SafeFilePath(iwadpath, "voices.wad");
Z_Free(iwadpath);

if(!M_FileExists(voiceswad))
Z_Free(voiceswad);
else
name = voiceswad; // STRIFE-FIXME: memory leak!!
name = M_FileCaseExists(voiceswad);
Z_Free(voiceswad);
}

// not found? try global search paths
Expand All @@ -877,6 +875,7 @@ void D_IdentifyVersion(void)
{
// add it.
D_AddFile(name);
free(name);
}
}
}
Expand Down

0 comments on commit 482d302

Please sign in to comment.