[Scummvm-cvs-logs] SF.net SVN: scummvm:[47393] scummvm/trunk

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Tue Jan 19 21:41:55 CET 2010


Revision: 47393
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47393&view=rev
Author:   eriktorbjorn
Date:     2010-01-19 20:41:51 +0000 (Tue, 19 Jan 2010)

Log Message:
-----------
Fixed some cppcheck warnings.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/wince/CEException.cpp
    scummvm/trunk/engines/gob/save/saveconverter_v2.cpp
    scummvm/trunk/engines/gob/save/saveconverter_v3.cpp
    scummvm/trunk/engines/gob/save/saveconverter_v4.cpp
    scummvm/trunk/engines/gob/save/saveconverter_v6.cpp
    scummvm/trunk/engines/lure/lure.cpp
    scummvm/trunk/engines/m4/graphics.cpp
    scummvm/trunk/sound/mods/tfmx.cpp

Modified: scummvm/trunk/backends/platform/wince/CEException.cpp
===================================================================
--- scummvm/trunk/backends/platform/wince/CEException.cpp	2010-01-19 20:02:17 UTC (rev 47392)
+++ scummvm/trunk/backends/platform/wince/CEException.cpp	2010-01-19 20:41:51 UTC (rev 47393)
@@ -69,7 +69,7 @@
 	if (ReadProcessMemory(hProcess, (LPCVOID)(context->Pc - (sizeof(memoryDump) / 2)), memoryDump, sizeof(memoryDump), &size)) {
 		for (i=0; i<size; i+=8) {
 			int j;
-			char digit[3];
+			char digit[4];
 			int max;
 			max = size - i;
 			if (max > 8)

Modified: scummvm/trunk/engines/gob/save/saveconverter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/save/saveconverter_v2.cpp	2010-01-19 20:02:17 UTC (rev 47392)
+++ scummvm/trunk/engines/gob/save/saveconverter_v2.cpp	2010-01-19 20:41:51 UTC (rev 47393)
@@ -67,7 +67,7 @@
 
 	// Read the description
 	if (save.read(desc, kSlotNameLength) != kSlotNameLength) {
-		delete desc;
+		delete[] desc;
 		return 0;
 	}
 

Modified: scummvm/trunk/engines/gob/save/saveconverter_v3.cpp
===================================================================
--- scummvm/trunk/engines/gob/save/saveconverter_v3.cpp	2010-01-19 20:02:17 UTC (rev 47392)
+++ scummvm/trunk/engines/gob/save/saveconverter_v3.cpp	2010-01-19 20:41:51 UTC (rev 47393)
@@ -75,7 +75,7 @@
 
 	// Read the description
 	if (save.read(desc, kSlotNameLength) != kSlotNameLength) {
-		delete desc;
+		delete[] desc;
 		return 0;
 	}
 

Modified: scummvm/trunk/engines/gob/save/saveconverter_v4.cpp
===================================================================
--- scummvm/trunk/engines/gob/save/saveconverter_v4.cpp	2010-01-19 20:02:17 UTC (rev 47392)
+++ scummvm/trunk/engines/gob/save/saveconverter_v4.cpp	2010-01-19 20:41:51 UTC (rev 47393)
@@ -71,7 +71,7 @@
 
 	// Read the description
 	if (save.read(desc, kSlotNameLength) != kSlotNameLength) {
-		delete desc;
+		delete[] desc;
 		return 0;
 	}
 

Modified: scummvm/trunk/engines/gob/save/saveconverter_v6.cpp
===================================================================
--- scummvm/trunk/engines/gob/save/saveconverter_v6.cpp	2010-01-19 20:02:17 UTC (rev 47392)
+++ scummvm/trunk/engines/gob/save/saveconverter_v6.cpp	2010-01-19 20:41:51 UTC (rev 47393)
@@ -67,7 +67,7 @@
 
 	// Read the description
 	if (save.read(desc, kSlotNameLength) != kSlotNameLength) {
-		delete desc;
+		delete[] desc;
 		return 0;
 	}
 

Modified: scummvm/trunk/engines/lure/lure.cpp
===================================================================
--- scummvm/trunk/engines/lure/lure.cpp	2010-01-19 20:02:17 UTC (rev 47392)
+++ scummvm/trunk/engines/lure/lure.cpp	2010-01-19 20:41:51 UTC (rev 47393)
@@ -134,8 +134,10 @@
 			CopyProtectionDialog *dialog = new CopyProtectionDialog();
 			bool result = dialog->show();
 			delete dialog;
-			if (shouldQuit())
+			if (shouldQuit()) {
+				delete gameInstance;
 				return Common::kNoError;
+			}
 
 			if (!result)
 				error("Sorry - copy protection failed");

Modified: scummvm/trunk/engines/m4/graphics.cpp
===================================================================
--- scummvm/trunk/engines/m4/graphics.cpp	2010-01-19 20:02:17 UTC (rev 47392)
+++ scummvm/trunk/engines/m4/graphics.cpp	2010-01-19 20:41:51 UTC (rev 47393)
@@ -106,6 +106,8 @@
 				*ptr++ = 0;
 		}
 	}
+
+	delete[] walkMap;
 }
 
 // Sprite related methods

Modified: scummvm/trunk/sound/mods/tfmx.cpp
===================================================================
--- scummvm/trunk/sound/mods/tfmx.cpp	2010-01-19 20:02:17 UTC (rev 47392)
+++ scummvm/trunk/sound/mods/tfmx.cpp	2010-01-19 20:41:51 UTC (rev 47393)
@@ -887,7 +887,7 @@
 		sampleAlloc[0] = sampleAlloc[1] = sampleAlloc[2] = sampleAlloc[3] = 0;
 		sampleLen = sampleSize;
 	} else {
-		delete sampleAlloc;
+		delete[] sampleAlloc;
 		warning("Tfmx: Encountered IO-Error");
 		return 0;
 	}
@@ -994,7 +994,7 @@
 		resource->mdatData = mdatAlloc - mdatOffset;
 		resource->mdatLen = mdatSize;
 	} else {
-		delete mdatAlloc;
+		delete[] mdatAlloc;
 		warning("Tfmx: Encountered IO-Error");
 		delete resource;
 		return 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list