mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-31 05:56:24 +08:00
fix a possible memory leak in SDL_vasprintf()
(cherry picked from commit 1a83bf2399)
This commit is contained in:
@@ -2004,6 +2004,7 @@ int SDL_vasprintf(char **strp, const char *fmt, va_list ap)
|
|||||||
|
|
||||||
/* Check error code */
|
/* Check error code */
|
||||||
if (retval < 0) {
|
if (retval < 0) {
|
||||||
|
SDL_free(p);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2025,5 +2026,3 @@ int SDL_vasprintf(char **strp, const char *fmt, va_list ap)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
||||||
|
|||||||
Reference in New Issue
Block a user