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