mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-07 11:58:12 +00:00
Fix error handling of SDL_AddHintCallback
This commit is contained in:

committed by
Sam Lantinga

parent
45bfa8e5e7
commit
5de3d1e9cc
@@ -282,6 +282,8 @@ int SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userd
|
|||||||
hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
|
hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
|
||||||
if (!hint) {
|
if (!hint) {
|
||||||
SDL_free(entry);
|
SDL_free(entry);
|
||||||
|
SDL_UnlockProperties(hints);
|
||||||
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
hint->value = NULL;
|
hint->value = NULL;
|
||||||
hint->priority = SDL_HINT_DEFAULT;
|
hint->priority = SDL_HINT_DEFAULT;
|
||||||
|
Reference in New Issue
Block a user