src/SDL_hints.c
changeset 9202 01bb8e3ba14f
parent 9201 21d9f9babb30
child 9204 b331795924d3
     1.1 --- a/src/SDL_hints.c	Wed Oct 29 20:20:47 2014 +0100
     1.2 +++ b/src/SDL_hints.c	Wed Oct 29 20:29:32 2014 +0100
     1.3 @@ -137,6 +137,10 @@
     1.4      SDL_DelHintCallback(name, callback, userdata);
     1.5  
     1.6      entry = (SDL_HintWatch *)SDL_malloc(sizeof(*entry));
     1.7 +    if (!entry) {
     1.8 +        SDL_OutOfMemory();
     1.9 +        return;
    1.10 +    }
    1.11      entry->callback = callback;
    1.12      entry->userdata = userdata;
    1.13  
    1.14 @@ -149,6 +153,7 @@
    1.15          /* Need to add a hint entry for this watcher */
    1.16          hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
    1.17          if (!hint) {
    1.18 +            SDL_OutOfMemory();
    1.19              if(entry)
    1.20              {
    1.21                SDL_free(entry);