INN commit: trunk (innfeed/host.c nnrpd/perl.c nnrpd/python.c)

INN Commit Russ_Allbery at isc.org
Sat Mar 28 18:56:10 UTC 2009


    Date: Saturday, March 28, 2009 @ 11:56:09
  Author: iulius
Revision: 8394

Remove useless xstrdup() calls in vector_add().  Memory has been
leaking in both innfeed (since commit 8176) and nnrpd (since
a long time).

Modified:
  trunk/innfeed/host.c
  trunk/nnrpd/perl.c
  trunk/nnrpd/python.c

----------------+
 innfeed/host.c |    8 ++++----
 nnrpd/perl.c   |    2 +-
 nnrpd/python.c |    2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

Modified: innfeed/host.c
===================================================================
--- innfeed/host.c	2009-03-26 19:14:45 UTC (rev 8393)
+++ innfeed/host.c	2009-03-28 18:56:09 UTC (rev 8394)
@@ -3369,20 +3369,20 @@
   if (host->ipAddrs) {
     int  i;
     char ip_addr[INET6_ADDRSTRLEN];
-    char *family;
+    const char *family;
 
     for(i = 0; host->ipAddrs[i] != NULL; i++) {
       switch(host->ipAddrs[i]->sa_family) {
         case AF_INET:
-          family = xstrdup("IPv4");
+          family = "IPv4";
           break;
 #ifdef HAVE_INET6
         case AF_INET6:
-          family = xstrdup("IPv6");
+          family = "IPv6";
           break;
 #endif
         default:
-          family = xstrdup("????");
+          family = "????";
           break;
       }
 

Modified: nnrpd/perl.c
===================================================================
--- nnrpd/perl.c	2009-03-26 19:14:45 UTC (rev 8393)
+++ nnrpd/perl.c	2009-03-28 18:56:09 UTC (rev 8394)
@@ -274,7 +274,7 @@
         strlcat(buffer, val, BIG_BUFFER);
         strlcat(buffer, "\"\n", BIG_BUFFER);
  
-        vector_add(access_vec, xstrdup(buffer));
+        vector_add(access_vec, buffer);
     }
 
     free(buffer);

Modified: nnrpd/python.c
===================================================================
--- nnrpd/python.c	2009-03-26 19:14:45 UTC (rev 8393)
+++ nnrpd/python.c	2009-03-28 18:56:09 UTC (rev 8394)
@@ -332,7 +332,7 @@
         strlcat(buffer, PyString_AsString(value), BIG_BUFFER);
         strlcat(buffer, "\"\n", BIG_BUFFER);
 
-        vector_add(access_vec, xstrdup(buffer));
+        vector_add(access_vec, buffer);
     }
 
     free(buffer);




More information about the inn-committers mailing list