SDL: fix a possible memory leak in SDL_vasprintf() (1a83b)

From 1a83bf2399c29f3028477225067bf6a106068f08 Mon Sep 17 00:00:00 2001
From: Ozkan Sezer <[EMAIL REDACTED]>
Date: Sun, 5 Nov 2023 20:01:02 +0300
Subject: [PATCH] fix a possible memory leak in SDL_vasprintf()

---
 src/stdlib/SDL_string.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c
index 0c97cc0248f8..9f434a46cbe0 100644
--- a/src/stdlib/SDL_string.c
+++ b/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;
         }