Windows: Free the argv we allocated for console_wmain().
authorRyan C. Gordon <icculus@icculus.org>
Thu, 19 Feb 2015 21:50:40 -0500
changeset 9368 31f9331d03a7
parent 9367 8acde42d7b81
child 9369 9bb7a7c0a66e
Windows: Free the argv we allocated for console_wmain().
src/main/windows/SDL_windows_main.c
--- a/src/main/windows/SDL_windows_main.c	Thu Feb 19 21:49:30 2015 -0500
+++ b/src/main/windows/SDL_windows_main.c	Thu Feb 19 21:50:40 2015 -0500
@@ -140,6 +140,7 @@
 int
 console_wmain(int argc, wchar_t *wargv[], wchar_t *wenvp)
 {
+    int retval = 0;
     char **argv = SDL_stack_alloc(char*, argc);
     int i;
 
@@ -147,7 +148,11 @@
         argv[i] = WIN_StringToUTF8(wargv[i]);
     }
 
-    return main_utf8(argc, argv);
+    retval = main_utf8(argc, argv);
+
+    SDL_stack_free(argv);
+
+    return retval;
 }
 #endif