INN commit: trunk (lib/clientactive.c nnrpd/misc.c nnrpd/perl.c)

INN Commit rra at isc.org
Tue Jun 25 17:40:26 UTC 2013


    Date: Tuesday, June 25, 2013 @ 10:40:26
  Author: iulius
Revision: 9496

fix a few resource leaks

A few files were remaining open.

Thanks to David Binderman for having reported the issue.

Modified:
  trunk/lib/clientactive.c
  trunk/nnrpd/misc.c
  trunk/nnrpd/perl.c

--------------------+
 lib/clientactive.c |    1 +
 nnrpd/misc.c       |    3 +++
 nnrpd/perl.c       |    5 +++++
 3 files changed, 9 insertions(+)

Modified: lib/clientactive.c
===================================================================
--- lib/clientactive.c	2013-06-25 17:27:44 UTC (rev 9495)
+++ lib/clientactive.c	2013-06-25 17:40:26 UTC (rev 9496)
@@ -74,6 +74,7 @@
 	if (strcmp(CApathname, pathname) == 0)
             CAclose();
 	errno = oerrno;
+        fclose(F);
 	return NULL;
     }
 

Modified: nnrpd/misc.c
===================================================================
--- nnrpd/misc.c	2013-06-25 17:27:44 UTC (rev 9495)
+++ nnrpd/misc.c	2013-06-25 17:40:26 UTC (rev 9496)
@@ -335,6 +335,7 @@
      if (fgets(buff,SMBUF,fp) == NULL) {
        syslog(L_ERROR, "%s Error reading '%s': %s",
               Client.host, path, strerror(errno));
+       fclose(fp);
        return 0;
      }
      *lastpost = atol(buff);
@@ -342,6 +343,7 @@
      if ((s = strchr(buff,',')) == NULL) {
        syslog(L_ERROR, "%s bad data in postrec file: '%s'",
               Client.host, buff);
+       fclose(fp);
        return 0;
      }
      s++; *lastsleep = atol(s);
@@ -349,6 +351,7 @@
      if ((s = strchr(s,',')) == NULL) {
        syslog(L_ERROR, "%s bad data in postrec file: '%s'",
               Client.host, buff);
+       fclose(fp);
        return 0;
      }
      s++; *lastn = atol(s);

Modified: nnrpd/perl.c
===================================================================
--- nnrpd/perl.c	2013-06-25 17:27:44 UTC (rev 9495)
+++ nnrpd/perl.c	2013-06-25 17:40:26 UTC (rev 9496)
@@ -217,6 +217,11 @@
 
     if (buf[0] != '\0')
         return buf;
+
+#ifdef DEBUG_MODIFY
+    fclose(flog);
+#endif /* DEBUG_MODIFY */
+
     return NULL;
 }
 



More information about the inn-committers mailing list