commit | ba62ead5ecc111070381c4d32d7b21dfc9bb1493 | [log] [tgz] |
---|---|---|
author | Sam Lantinga <slouken@libsdl.org> | Mon Apr 18 13:45:41 2022 -0700 |
committer | Sam Lantinga <slouken@libsdl.org> | Thu Apr 21 08:47:41 2022 -0700 |
tree | 4821409fe4ea27a5a0c351ffac7c3d6e4f222f51 | |
parent | 145824f6ab46e38926beda87736fd240856078bf [diff] |
Handle potential out of memory condition when working with hints
diff --git a/src/SDL_hints.c b/src/SDL_hints.c index 2eea550..d3fc8ab 100644 --- a/src/SDL_hints.c +++ b/src/SDL_hints.c
@@ -178,6 +178,11 @@ return; } hint->name = SDL_strdup(name); + if (!hint->name) { + SDL_free(hint); + SDL_OutOfMemory(); + return; + } hint->value = NULL; hint->priority = SDL_HINT_DEFAULT; hint->callbacks = NULL;