[Commits] SDL: WinRT: Removed dead code and fixed memory leak if allocatio...

libsdl.org revision control commits-owner at libsdl.org
Thu Mar 10 12:06:00 PST 2016


details:   https://hg.libsdl.org/SDL/rev/f3c18811079d
changeset: 10112:f3c18811079d
user:      Philipp Wiesemann <philipp.wiesemann at arcor.de>
date:      Thu Mar 10 21:00:44 2016 +0100
description:
WinRT: Removed dead code and fixed memory leak if allocation for driver failed.

diffstat:

 src/video/winrt/SDL_winrtvideo.cpp |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r c14536d0deff -r f3c18811079d 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);


More information about the commits mailing list