فهرست منبع

Fix mismatched new/delete

The buffers allocated with new[] need to be freed with delete[] not
plain delete.
Jonathan Wakely 4 سال پیش
والد
کامیت
67839e5494
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      lib/SCSI2SD/src/scsi2sd-util6/TerminalWx/src/GTerm/gterm.cpp

+ 3 - 3
lib/SCSI2SD/src/scsi2sd-util6/TerminalWx/src/GTerm/gterm.cpp

@@ -106,11 +106,11 @@ GTerm::GTerm(int w, int h) : width(w), height(h)
 
 GTerm::~GTerm()
 {
-	delete text;
-	delete color;
+	delete[] text;
+	delete[] color;
 #ifdef GTERM_PC
         if(pc_machinename)
-          delete pc_machinename;
+          delete[] pc_machinename;
 #endif // GTERM_PC
 }