From fe46569cce4b9b14ab6d415a152ccd5b4c6abc0e Mon Sep 17 00:00:00 2001 From: Mathieu Eyraud <70028899+meyraud705@users.noreply.github.com> Date: Sat, 21 May 2022 10:44:50 +0200 Subject: [PATCH] Fix potential memory leak in SDL_AddHintCallback --- src/SDL_hints.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SDL_hints.c b/src/SDL_hints.c index d3fc8ab46e..0005f4908e 100644 --- a/src/SDL_hints.c +++ b/src/SDL_hints.c @@ -179,6 +179,7 @@ SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata) } hint->name = SDL_strdup(name); if (!hint->name) { + SDL_free(entry); SDL_free(hint); SDL_OutOfMemory(); return;