allocate string freed with free() later using malloc(), not new[] (fixes patch 772404)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22044 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -172,7 +172,9 @@ wxChar **ConvertToStandardCommandArgs(const wxChar *p, int& argc)
|
||||
// and +1 here for the terminating NULL
|
||||
wxChar **argv = new wxChar *[argc + 1];
|
||||
|
||||
argv[0] = new wxChar[MAX_PATH];
|
||||
// as we use wxStrdup below we must allocate the first argument using
|
||||
// malloc(), not new[], as well
|
||||
argv[0] = (wxChar *)malloc(MAX_PATH * sizeof(wxChar));
|
||||
::GetModuleFileName(wxhInstance, argv[0], MAX_PATH);
|
||||
|
||||
// copy all the other arguments to wxApp::argv[]
|
||||
|
Reference in New Issue
Block a user