src/SDL_hints.c
changeset 9201 21d9f9babb30
parent 8149 681eb46b8ac4
child 9202 01bb8e3ba14f
     1.1 --- a/src/SDL_hints.c	Mon Oct 27 19:53:44 2014 -0400
     1.2 +++ b/src/SDL_hints.c	Wed Oct 29 20:20:47 2014 +0100
     1.3 @@ -149,6 +149,11 @@
     1.4          /* Need to add a hint entry for this watcher */
     1.5          hint = (SDL_Hint *)SDL_malloc(sizeof(*hint));
     1.6          if (!hint) {
     1.7 +            if(entry)
     1.8 +            {
     1.9 +              SDL_free(entry);
    1.10 +              entry = NULL;
    1.11 +            }
    1.12              return;
    1.13          }
    1.14          hint->name = SDL_strdup(name);