From 674eb5563807856935fdf2676e844c71cb5dab89 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 19 Feb 2015 21:50:40 -0500 Subject: [PATCH] Windows: Free the argv we allocated for console_wmain(). --- src/main/windows/SDL_windows_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/windows/SDL_windows_main.c b/src/main/windows/SDL_windows_main.c index eac904e27..7ccca75e6 100644 --- a/src/main/windows/SDL_windows_main.c +++ b/src/main/windows/SDL_windows_main.c @@ -140,6 +140,7 @@ console_ansi_main(int argc, char *argv[]) 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 @@ console_wmain(int argc, wchar_t *wargv[], wchar_t *wenvp) argv[i] = WIN_StringToUTF8(wargv[i]); } - return main_utf8(argc, argv); + retval = main_utf8(argc, argv); + + SDL_stack_free(argv); + + return retval; } #endif