diff --git a/rostests/rosautotest/CWineTest.cpp b/rostests/rosautotest/CWineTest.cpp index 853204ab6f3..119b87d7645 100644 --- a/rostests/rosautotest/CWineTest.cpp +++ b/rostests/rosautotest/CWineTest.cpp @@ -178,7 +178,7 @@ CWineTest::GetNextTest() m_CurrentFile.clear(); /* Also free the memory for the list buffer */ - delete m_ListBuffer; + delete[] m_ListBuffer; m_ListBuffer = NULL; return false; diff --git a/rostests/rosautotest/tools.cpp b/rostests/rosautotest/tools.cpp index 0a58850af21..413a2b8aa18 100644 --- a/rostests/rosautotest/tools.cpp +++ b/rostests/rosautotest/tools.cpp @@ -196,7 +196,7 @@ GetINIValue(PCWCH AppName, PCWCH KeyName, PCWCH FileName) WideCharToMultiByte(CP_ACP, 0, Buffer, Length + 1, AsciiBuffer, Length + 1, NULL, NULL); ReturnedString = AsciiBuffer; - delete AsciiBuffer; + delete[] AsciiBuffer; } return ReturnedString;