Bug 1786 - memory leak in WIN_GetDisplayModes by Marcel Bakker
authorGabriel Jacobo <gabomdq@gmail.com>
Wed, 24 Apr 2013 11:49:52 -0300
changeset 7102 b9fa5a2acbfd
parent 7101 ea2e8eb622e1
child 7103 9d146930d4f2
Bug 1786 - memory leak in WIN_GetDisplayModes by Marcel Bakker
src/video/windows/SDL_windowsmodes.c
--- a/src/video/windows/SDL_windowsmodes.c	Tue Apr 23 20:45:49 2013 -0700
+++ b/src/video/windows/SDL_windowsmodes.c	Wed Apr 24 11:49:52 2013 -0300
@@ -245,6 +245,7 @@
         }
         if (SDL_ISPIXELFORMAT_INDEXED(mode.format)) {
             /* We don't support palettized modes now */
+            SDL_free(mode.driverdata);
             continue;
         }
         if (mode.format != SDL_PIXELFORMAT_UNKNOWN) {
@@ -252,6 +253,9 @@
                 SDL_free(mode.driverdata);
             }
         }
+        else {
+            SDL_free(mode.driverdata);
+        }
     }
 }