Windows: Free the argv we allocated for console_wmain().
authorRyan C. Gordon <icculus@icculus.org>
Thu, 19 Feb 2015 21:50:40 -0500
changeset 936831f9331d03a7
parent 9367 8acde42d7b81
child 9369 9bb7a7c0a66e
Windows: Free the argv we allocated for console_wmain().
src/main/windows/SDL_windows_main.c
     1.1 --- a/src/main/windows/SDL_windows_main.c	Thu Feb 19 21:49:30 2015 -0500
     1.2 +++ b/src/main/windows/SDL_windows_main.c	Thu Feb 19 21:50:40 2015 -0500
     1.3 @@ -140,6 +140,7 @@
     1.4  int
     1.5  console_wmain(int argc, wchar_t *wargv[], wchar_t *wenvp)
     1.6  {
     1.7 +    int retval = 0;
     1.8      char **argv = SDL_stack_alloc(char*, argc);
     1.9      int i;
    1.10  
    1.11 @@ -147,7 +148,11 @@
    1.12          argv[i] = WIN_StringToUTF8(wargv[i]);
    1.13      }
    1.14  
    1.15 -    return main_utf8(argc, argv);
    1.16 +    retval = main_utf8(argc, argv);
    1.17 +
    1.18 +    SDL_stack_free(argv);
    1.19 +
    1.20 +    return retval;
    1.21  }
    1.22  #endif
    1.23