[MPlayer-cvslog] r32776 - trunk/TOOLS/avisubdump.c

siretart subversion at mplayerhq.hu
Sun Jan 9 21:21:46 CET 2011


Author: siretart
Date: Sun Jan  9 21:21:45 2011
New Revision: 32776

Log:
add missing fclose()

found by cppcheck:
[avisubdump.c:199]: (error) Resource leak: f

Modified:
   trunk/TOOLS/avisubdump.c

Modified: trunk/TOOLS/avisubdump.c
==============================================================================
--- trunk/TOOLS/avisubdump.c	Sun Jan  9 21:03:56 2011	(r32775)
+++ trunk/TOOLS/avisubdump.c	Sun Jan  9 21:21:45 2011	(r32776)
@@ -180,8 +180,12 @@ int main(int argc,char* argv[])
 		exit(1);
 	}
 
-	if (strcmp(argv[argc-1], "-") == 0) f=stdin;
-	else f=fopen(argv[argc-1],"rb");
+	if (strcmp(argv[argc-1], "-") == 0) {
+		dump(stdin);
+		return 0;
+	}
+
+	f=fopen(argv[argc-1],"rb");
 
 	if (!f) {
 		fprintf(stderr, "Could not open '%s': %s\n",
@@ -190,6 +194,7 @@ int main(int argc,char* argv[])
 	}
 
 	dump(f);
+	fclose(f);
 
 	return 0;
 }


More information about the MPlayer-cvslog mailing list