WinRT: Removed dead code and fixed memory leak if allocation for driver failed.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Thu, 10 Mar 2016 21:00:44 +0100
changeset 10112 f3c18811079d
parent 10111 c14536d0deff
child 10113 991977532d7f
WinRT: Removed dead code and fixed memory leak if allocation for driver failed.
src/video/winrt/SDL_winrtvideo.cpp
--- a/src/video/winrt/SDL_winrtvideo.cpp	Thu Mar 10 21:00:27 2016 +0100
+++ b/src/video/winrt/SDL_winrtvideo.cpp	Thu Mar 10 21:00:44 2016 +0100
@@ -118,15 +118,13 @@
     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);