foxygit / doom Log in
commit de9163ef5383c13c48178a3a6746d820ad14e6f1
Author:     Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Tue Sep 4 15:32:34 2018 +0200
Commit:     Fabian Greffrath <fabian@greffrath.com>
CommitDate: Tue Sep 4 15:32:34 2018 +0200

    config: let GetDefaultConfigDir() never return NULL

    Fixes #1083, thanks @Pickle
---
 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 7b22d795..c39b9f60 100644
--- a/src/m_config.c
+++ b/src/m_config.c
@@ -2173,7 +2173,10 @@ static char *GetDefaultConfigDir(void)
     char *result;

     result = SDL_GetPrefPath("", PACKAGE_TARNAME);
-    return result;
+    if (result != NULL)
+    {
+        return result;
+    }
 #endif /* #ifndef _WIN32 */
     return M_StringDuplicate("");
 }