SDL_iconv_string: avoid memory leak if realloc() fails.

main
Ozkan Sezer 2021-12-02 02:28:24 +03:00
parent f14a8bfa4e
commit a2b13e585c
1 changed files with 1 additions and 0 deletions

View File

@ -867,6 +867,7 @@ SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf,
stringsize *= 2;
string = (char *) SDL_realloc(string, stringsize);
if (!string) {
SDL_free(oldstring);
SDL_iconv_close(cd);
return NULL;
}