From ca20ca3a3e7d43ce41fbdfdddd26382ea751c702 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Tue, 1 Oct 2019 11:11:57 +0000 Subject: [PATCH] use delete instead of free, although this code is never really used, as the running process should have been replaced at that point. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4263 --- src/gui/sdlmain.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 8ecc5711..dd0c64f9 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -1866,11 +1866,11 @@ extern void DEBUG_ShutDown(Section * /*sec*/); #endif void restart_program(std::vector & parameters) { - char** newargs = new char* [parameters.size()+1]; + char** newargs = new char* [parameters.size() + 1]; // parameter 0 is the executable path // contents of the vector follow // last one is NULL - for(Bitu i = 0; i < parameters.size(); i++) newargs[i]=(char*)parameters[i].c_str(); + for(Bitu i = 0; i < parameters.size(); i++) newargs[i] = (char*)parameters[i].c_str(); newargs[parameters.size()] = NULL; SDL_CloseAudio(); SDL_Delay(50); @@ -1892,7 +1892,7 @@ void restart_program(std::vector & parameters) { #endif E_Exit("Restarting failed"); } - free(newargs); + delete [] newargs; } void Restart(bool pressed) { // mapper handler restart_program(control->startup_params);