Jelajahi Sumber

Fixed memory leak in failure case that static analysis found.

Ryan C. Gordon 11 tahun lalu
induk
melakukan
2afa4aeda8
1 mengubah file dengan 1 tambahan dan 0 penghapusan
  1. 1 0
      src/video/cocoa/SDL_cocoamodes.m

+ 1 - 0
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;