Fix potential memory leak in SDL_AddHintCallback

main
Mathieu Eyraud 2022-05-21 10:44:50 +02:00 committed by Sam Lantinga
parent e4b5afa576
commit fe46569cce
1 changed files with 1 additions and 0 deletions

View File

@ -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;