diff cinst/main.c @ 339:5fa58979cb3a

Fix ressource leak found by cppcheck
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 09 Apr 2014 14:32:55 +0000
parents c89bfb0e638e
children 124f08a85532
line wrap: on
line diff
--- a/cinst/main.c	Wed Apr 09 14:26:53 2014 +0000
+++ b/cinst/main.c	Wed Apr 09 14:32:55 2014 +0000
@@ -107,11 +107,13 @@
       if (len <= 3)
         {
           printf ("Line too short.\n");
+          fclose (f);
           return ERR_INVALID_INPUT;
         }
       if (lines_read++ > MAX_LINES)
         {
           printf ("Too many lines\n");
+          fclose (f);
           return ERR_TOO_MUCH_INPUT;
         }
       if (*buf == 'I')
@@ -132,6 +134,7 @@
         }
     }
 
+  fclose (f);
   return 0;
 }
 

http://wald.intevation.org/projects/trustbridge/