Emscripten: Fixed memory leak if SDL_GetPrefPath() failed.

This commit is contained in:
Philipp Wiesemann 2015-04-15 21:25:15 +02:00
parent e97fc56209
commit 86fb92a7da
1 changed files with 1 additions and 0 deletions

View File

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