Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Bug 1786 - memory leak in WIN_GetDisplayModes by Marcel Bakker
Browse files Browse the repository at this point in the history
  • Loading branch information
gabomdq committed Apr 24, 2013
1 parent f585ced commit 74c7dff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/video/windows/SDL_windowsmodes.c
Expand Up @@ -245,13 +245,17 @@ WIN_GetDisplayModes(_THIS, SDL_VideoDisplay * display)
}
if (SDL_ISPIXELFORMAT_INDEXED(mode.format)) {
/* We don't support palettized modes now */
SDL_free(mode.driverdata);
continue;
}
if (mode.format != SDL_PIXELFORMAT_UNKNOWN) {
if (!SDL_AddDisplayMode(display, &mode)) {
SDL_free(mode.driverdata);
}
}
else {
SDL_free(mode.driverdata);
}
}
}

Expand Down

0 comments on commit 74c7dff

Please sign in to comment.