commit b9f75eb05e0ce716e001ad89635758648d6f9ab9
Author: mfrancis95 <mikefrancis95@gmail.com>
AuthorDate: Sat Dec 8 20:56:01 2018 -0500
Commit: mfrancis95 <mikefrancis95@gmail.com>
CommitDate: Mon Dec 10 23:23:48 2018 -0500
Fix memory leak in Strife related to finding voices.wad (fix #1118)
---
src/strife/d_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/strife/d_main.c b/src/strife/d_main.c
index 54218398..a11c6226 100644
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -858,7 +858,7 @@ void D_IdentifyVersion(void)
if(!M_FileExists(voiceswad))
Z_Free(voiceswad);
else
- name = voiceswad; // STRIFE-FIXME: memory leak!!
+ name = voiceswad;
}
// not found? try global search paths
@@ -877,6 +877,7 @@ void D_IdentifyVersion(void)
{
// add it.
D_AddFile(name);
+ p ? Z_Free(name) : free(name);
}
}
}