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

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


    Date: Tuesday, June 25, 2013 @ 10:40:59
  Author: iulius
Revision: 9497

fix a few resource leaks

A few files were remaining open.

Thanks to David Binderman for having reported the issue.

Modified:
  branches/2.5/lib/clientactive.c
  branches/2.5/nnrpd/misc.c
  branches/2.5/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:40:26 UTC (rev 9496)
+++ lib/clientactive.c	2013-06-25 17:40:59 UTC (rev 9497)
@@ -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:40:26 UTC (rev 9496)
+++ nnrpd/misc.c	2013-06-25 17:40:59 UTC (rev 9497)
@@ -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:40:26 UTC (rev 9496)
+++ nnrpd/perl.c	2013-06-25 17:40:59 UTC (rev 9497)
@@ -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