浏览代码

Emscripten: Fixed memory leak if SDL_GetPrefPath() failed.

Philipp Wiesemann 10 年之前
父节点
当前提交
86fb92a7da
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/filesystem/emscripten/SDL_sysfilesystem.c

+ 1 - 0
src/filesystem/emscripten/SDL_sysfilesystem.c

@@ -57,6 +57,7 @@ SDL_GetPrefPath(const char *org, const char *app)
 
     if (mkdir(retval, 0700) != 0 && errno != EEXIST) {
         SDL_SetError("Couldn't create directory '%s': '%s'", retval, strerror(errno));
+        SDL_free(retval);
         return NULL;
     }