Fix error handling of SDL_AddHintCallback

This commit is contained in:
Mathieu Eyraud authored and Sam Lantinga committed 2024-08-11 06:59:10 -07:00
1 parent 45bfa8e5e7
commit 5de3d1e9cc
1 file changed
+2
+2
View File
@@ -282,6 +282,8 @@ int SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userd
hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
if (!hint) {
SDL_free(entry);
SDL_UnlockProperties(hints);
return -1;
} else {
hint->value = NULL;
hint->priority = SDL_HINT_DEFAULT;