]> granicus.if.org Git - file/commitdiff
fix resource leak: Thomas Jarosch thomas dot jarosch at intra2net dot com
authorChristos Zoulas <christos@zoulas.com>
Sun, 28 Aug 2011 07:03:27 +0000 (07:03 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sun, 28 Aug 2011 07:03:27 +0000 (07:03 +0000)
src/apptype.c

index 84c0133bb67cb37b1b8ed0f40e341999bf683556..128155a2d81291758d15c618c685924f38b19a0d 100644 (file)
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: apptype.c,v 1.10 2009/02/03 20:27:51 christos Exp $")
+FILE_RCSID("@(#)$File: apptype.c,v 1.11 2009/02/04 18:24:32 christos Exp $")
 #endif /* lint */
 
 #include <stdlib.h>
@@ -72,6 +72,7 @@ file_os2_apptype(struct magic_set *ms, const char *fn, const void *buf,
                if (fwrite(buf, 1, nb, fp) != nb) {
                        file_error(ms, errno, "cannot write tmp file `%s'",
                            path);
+                       (void)fclse(fp);
                        return -1;
                }
                (void)fclose(fp);