Skip to content

Commit

Permalink
WinRT: Removed dead code and fixed memory leak if allocation for driv…
Browse files Browse the repository at this point in the history
…er failed.
  • Loading branch information
philippwiesemann committed Mar 10, 2016
1 parent b82f48b commit 0c923fd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/video/winrt/SDL_winrtvideo.cpp
Expand Up @@ -118,15 +118,13 @@ WINRT_CreateDevice(int devindex)
device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
if (!device) {
SDL_OutOfMemory();
if (device) {
SDL_free(device);
}
return (0);
}

data = (SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
if (!data) {
SDL_OutOfMemory();
SDL_free(device);
return (0);
}
SDL_zerop(data);
Expand Down

0 comments on commit 0c923fd

Please sign in to comment.