Commit 2afa4aeda8b406980f14559049d908abbd45c41b

Ryan C. Gordon 2015-04-10T21:15:51

Fixed memory leak in failure case that static analysis found.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/video/cocoa/SDL_cocoamodes.m b/src/video/cocoa/SDL_cocoamodes.m
index b3025c4..bc485b4 100644
--- a/src/video/cocoa/SDL_cocoamodes.m
+++ b/src/video/cocoa/SDL_cocoamodes.m
@@ -193,6 +193,7 @@ GetDisplayMode(_THIS, const void *moderef, CVDisplayLinkRef link, SDL_DisplayMod
         break;
     case 8: /* We don't support palettized modes now */
     default: /* Totally unrecognizable bit depth. */
+        SDL_free(data);
         return SDL_FALSE;
     }
     mode->w = width;