commit 756d1ea6f14dc70e84bd22ed7f127e02e2faf855
Author: Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>
AuthorDate: Sun Oct 6 05:21:06 2019 -0400
Commit: Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org>
CommitDate: Sun Oct 6 05:23:26 2019 -0400
Use SDL_free with SDL pointers.
---
src/m_config.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/m_config.c b/src/m_config.c
index ce05a050..c88cd274 100644
--- a/src/m_config.c
+++ b/src/m_config.c
@@ -2185,11 +2185,14 @@ static char *GetDefaultConfigDir(void)
// Vanilla Doom and save in the current directory.
char *result;
+ char *copy;
result = SDL_GetPrefPath("", PACKAGE_TARNAME);
if (result != NULL)
{
- return result;
+ copy = M_StringDuplicate(result);
+ SDL_free(result);
+ return copy;
}
#endif /* #ifndef _WIN32 */
return M_StringDuplicate("");