diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index 7353d45912..b36fda42d1 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -1989,6 +1989,7 @@ int SDL_vasprintf(char **strp, const char *fmt, va_list ap) /* Check error code */ if (retval < 0) { + SDL_free(p); return retval; } @@ -2010,5 +2011,3 @@ int SDL_vasprintf(char **strp, const char *fmt, va_list ap) } } } - -/* vi: set ts=4 sw=4 expandtab: */