mirror of
https://github.com/encounter/SDL.git
synced 2025-05-22 07:11:23 +00:00
Fix potential memory leak in SDL_AddHintCallback
This commit is contained in:
parent
e4b5afa576
commit
fe46569cce
@ -179,6 +179,7 @@ SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
|
|||||||
}
|
}
|
||||||
hint->name = SDL_strdup(name);
|
hint->name = SDL_strdup(name);
|
||||||
if (!hint->name) {
|
if (!hint->name) {
|
||||||
|
SDL_free(entry);
|
||||||
SDL_free(hint);
|
SDL_free(hint);
|
||||||
SDL_OutOfMemory();
|
SDL_OutOfMemory();
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user