INN commit: trunk/frontends (sys2nf.c)

INN Commit rra at isc.org
Thu May 5 13:31:10 UTC 2016


    Date: Thursday, May 5, 2016 @ 06:31:10
  Author: iulius
Revision: 10031

sys2nf:  fix resource leak if the first condition is true

Modified:
  trunk/frontends/sys2nf.c

----------+
 sys2nf.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Modified: sys2nf.c
===================================================================
--- sys2nf.c	2016-05-05 13:21:29 UTC (rev 10030)
+++ sys2nf.c	2016-05-05 13:31:10 UTC (rev 10031)
@@ -313,8 +313,15 @@
 	else
 	    fprintf(F, "\t:HELP%s\\\n", f3);
 	fprintf(F, "\t:%s\n", f4);
-	if (ferror(F) || fclose(F) == EOF)
-	    perror(TEMPFILE), exit(1);
+        if (ferror(F) != 0) {
+            perror(TEMPFILE);
+            fclose(F);
+            exit(1);
+        }
+       if (fclose(F) == EOF) {
+            perror(TEMPFILE);
+            exit(1);
+        }
 
 	free(site);
 



More information about the inn-committers mailing list