Sfoglia il codice sorgente

Fix potential memory leak in SDL_AddHintCallback

Mathieu Eyraud 3 anni fa
parent
commit
fe46569cce
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  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;