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

tdhs at users.sourceforge.net tdhs at users.sourceforge.net
Fri Jan 15 21:01:56 CET 2010


Revision: 47310
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47310&view=rev
Author:   tdhs
Date:     2010-01-15 20:01:55 +0000 (Fri, 15 Jan 2010)

Log Message:
-----------
Fixed extract_agos, compress_tinsel, sciunpack and tools.h for warnings given by cppcheck.
Compiles fine, but slightly unsure of possible effect of tools.h change. Needs testing.

Modified Paths:
--------------
    tools/trunk/engines/agos/extract_agos.cpp
    tools/trunk/engines/tinsel/compress_tinsel.cpp
    tools/trunk/sci/sciunpack.cpp
    tools/trunk/tools.h

Modified: tools/trunk/engines/agos/extract_agos.cpp
===================================================================
--- tools/trunk/engines/agos/extract_agos.cpp	2010-01-15 18:01:49 UTC (rev 47309)
+++ tools/trunk/engines/agos/extract_agos.cpp	2010-01-15 20:01:55 UTC (rev 47310)
@@ -53,14 +53,13 @@
 	if (out) {
 		if (simon_decr(x, out, _filelen)) {
 			savefile(_outputPath.getFullPath(), out, decrlen);
+			free(x);
+			free(out);
 		} else {
 			free(x);
 			free(out);
 			error("%s: decrunch error\n", infilename.getFullPath().c_str());
 		}
-
-		free(x);
-		free(out);
 	}
 }
 

Modified: tools/trunk/engines/tinsel/compress_tinsel.cpp
===================================================================
--- tools/trunk/engines/tinsel/compress_tinsel.cpp	2010-01-15 18:01:49 UTC (rev 47309)
+++ tools/trunk/engines/tinsel/compress_tinsel.cpp	2010-01-15 20:01:55 UTC (rev 47310)
@@ -158,6 +158,7 @@
 	outBuffer = (int16 *)malloc(uncompressedSize);
 	if (!outBuffer) {
 		print("malloc failed!\n");
+		free(inBuffer);
 		return;
 	}
 

Modified: tools/trunk/sci/sciunpack.cpp
===================================================================
--- tools/trunk/sci/sciunpack.cpp	2010-01-15 18:01:49 UTC (rev 47309)
+++ tools/trunk/sci/sciunpack.cpp	2010-01-15 20:01:55 UTC (rev 47310)
@@ -437,6 +437,7 @@
 					guint8 *outdata = makeMIDI0(found->data, &midilength, midimask);
 					if (!outdata) {
 						fprintf(stderr, "MIDI conversion failed. Aborting...\n");
+						close(outf);
 						return;
 					}
 					if (verbose) printf("MIDI conversion from %d bytes of sound resource"

Modified: tools/trunk/tools.h
===================================================================
--- tools/trunk/tools.h	2010-01-15 18:01:49 UTC (rev 47309)
+++ tools/trunk/tools.h	2010-01-15 20:01:55 UTC (rev 47310)
@@ -33,7 +33,7 @@
 class Tools {
 public:
 	Tools();
-	~Tools();
+	virtual ~Tools();
 
 	typedef std::vector<Tool *> ToolList;
 


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