changeset 32689:5f505a260e9c

add missing fclose() found by cppcheck: [avisubdump.c:199]: (error) Resource leak: f
author siretart
date Sun, 09 Jan 2011 20:21:45 +0000
parents 675679c82f5f
children 55953c41f4ae
files TOOLS/avisubdump.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/TOOLS/avisubdump.c	Sun Jan 09 20:03:56 2011 +0000
+++ b/TOOLS/avisubdump.c	Sun Jan 09 20:21:45 2011 +0000
@@ -180,8 +180,12 @@
 		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 @@
 	}
 
 	dump(f);
+	fclose(f);
 
 	return 0;
 }