Browse Source

fix a possible memory leak in SDL_vasprintf()

Ozkan Sezer 1 year ago
parent
commit
1a83bf2399
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/stdlib/SDL_string.c

+ 1 - 0
src/stdlib/SDL_string.c

@@ -2201,6 +2201,7 @@ int SDL_vasprintf(char **strp, const char *fmt, va_list ap)
 
         /* Check error code */
         if (retval < 0) {
+            SDL_free(p);
             return retval;
         }