Explorar o código

Fix potential memory leak in SDL_AddHintCallback

Mathieu Eyraud %!s(int64=3) %!d(string=hai) anos
pai
achega
fe46569cce
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      src/SDL_hints.c

+ 1 - 0
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;