[Scummvm-cvs-logs] SF.net SVN: scummvm:[47539] tools/trunk/sci/scipack.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Jan 25 02:08:18 CET 2010


Revision: 47539
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47539&view=rev
Author:   lordhoto
Date:     2010-01-25 01:08:18 +0000 (Mon, 25 Jan 2010)

Log Message:
-----------
Properly close file descriptors in scipack (reported by cppcheck).

Modified Paths:
--------------
    tools/trunk/sci/scipack.cpp

Modified: tools/trunk/sci/scipack.cpp
===================================================================
--- tools/trunk/sci/scipack.cpp	2010-01-25 01:01:58 UTC (rev 47538)
+++ tools/trunk/sci/scipack.cpp	2010-01-25 01:08:18 UTC (rev 47539)
@@ -140,6 +140,7 @@
 
 	resource_map = creat("resource.map", 0644);
 	if (resource_map < 0) {
+		close(resource_000);
 		perror("While creating 'resource.map'");
 		return -1;
 	}
@@ -155,6 +156,8 @@
 		int bot_offset = offset & 0xffff;
 
 		if (fd < 0) {
+			close(resource_000);
+			close(resource_map);
 			perror(names[i]);
 			return -1;
 		}


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