diff --git a/src/cpu/core_dyn_x86/dyn_fpu.h b/src/cpu/core_dyn_x86/dyn_fpu.h index 9d261c1a..6e1f31db 100644 --- a/src/cpu/core_dyn_x86/dyn_fpu.h +++ b/src/cpu/core_dyn_x86/dyn_fpu.h @@ -98,7 +98,7 @@ static void dyn_fpu_esc0(){ if (decode.modrm.val >= 0xc0) { dyn_fpu_top(); Bitu group=(decode.modrm.val >> 3) & 7; - Bitu sub=(decode.modrm.val & 7); + //Bitu sub=(decode.modrm.val & 7); switch (group){ case 0x00: //FADD ST,STi / gen_call_function((void*)&FPU_FADD,"%Drd%Drd",DREG(TMPB),DREG(EA)); @@ -424,7 +424,7 @@ static void dyn_fpu_esc3(){ static void dyn_fpu_esc4(){ dyn_get_modrm(); Bitu group=(decode.modrm.val >> 3) & 7; - Bitu sub=(decode.modrm.val & 7); + //Bitu sub=(decode.modrm.val & 7); if (decode.modrm.val >= 0xc0) { dyn_fpu_top(); switch(group){ diff --git a/src/cpu/core_dyn_x86/dyn_fpu_dh.h b/src/cpu/core_dyn_x86/dyn_fpu_dh.h index 6899d5d8..b995cb06 100644 --- a/src/cpu/core_dyn_x86/dyn_fpu_dh.h +++ b/src/cpu/core_dyn_x86/dyn_fpu_dh.h @@ -298,8 +298,6 @@ static void dh_fpu_esc3(){ static void dh_fpu_esc4(){ dyn_get_modrm(); - Bitu group=(decode.modrm.val >> 3) & 7; - Bitu sub=(decode.modrm.val & 7); if (decode.modrm.val >= 0xc0) { cache_addb(0xdc); cache_addb(decode.modrm.val); @@ -356,8 +354,6 @@ static void dh_fpu_esc5(){ static void dh_fpu_esc6(){ dyn_get_modrm(); - Bitu group=(decode.modrm.val >> 3) & 7; - Bitu sub=(decode.modrm.val & 7); if (decode.modrm.val >= 0xc0) { cache_addb(0xde); cache_addb(decode.modrm.val); diff --git a/src/dos/dos_execute.cpp b/src/dos/dos_execute.cpp index bf180268..543ce108 100644 --- a/src/dos/dos_execute.cpp +++ b/src/dos/dos_execute.cpp @@ -315,6 +315,7 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) { envseg=block.exec.envseg; if (!MakeEnv(name,&envseg)) { DOS_CloseFile(fhandle); + delete [] loadbuf; return false; } /* Get Memory */ 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); diff --git a/src/hardware/ipx.cpp b/src/hardware/ipx.cpp index 8b410dae..9783df28 100644 --- a/src/hardware/ipx.cpp +++ b/src/hardware/ipx.cpp @@ -1072,7 +1072,7 @@ Bitu IPX_ESRHandler(void) { CALLBACK_RunRealFar(RealSeg(ESRList->getESRAddr()), RealOff(ESRList->getESRAddr())); } - delete ESRList; + delete ESRList; //Destructor updates this pointer to the next value or NULL } // while IO_WriteB(0xa0,0x63); //EOI11 diff --git a/src/hardware/serialport/libserial.cpp b/src/hardware/serialport/libserial.cpp index 3b0a4520..b7f524f2 100644 --- a/src/hardware/serialport/libserial.cpp +++ b/src/hardware/serialport/libserial.cpp @@ -289,6 +289,7 @@ bool SERIAL_open(const char* portname, COMPORT* port) { size_t len = strlen(portname); if(len > 240) { + free(cp); ///////////////////////////////////SetLastError(ERROR_BUFFER_OVERFLOW); return false; } diff --git a/src/shell/shell.cpp b/src/shell/shell.cpp index 88691abb..34610c3a 100644 --- a/src/shell/shell.cpp +++ b/src/shell/shell.cpp @@ -134,7 +134,10 @@ AutoexecObject::~AutoexecObject(){ if ((strncasecmp(buf2,"set ",4) == 0) && (strlen(buf2) > 4)){ char* after_set = buf2 + 4;//move to variable that is being set char* test = strpbrk(after_set,"="); - if (!test) continue; + if (!test) { + delete [] buf2; + continue; + } *test = 0; stringset = true; //If the shell is running/exists update the environment diff --git a/src/shell/shell_misc.cpp b/src/shell/shell_misc.cpp index 8723014e..e0282898 100644 --- a/src/shell/shell_misc.cpp +++ b/src/shell/shell_misc.cpp @@ -368,7 +368,7 @@ void DOS_Shell::InputCommand(char * line) { // remove current command from history if it's there if (current_hist) { - current_hist=false; + // current_hist=false; l_history.pop_front(); }