[net-tools] fixed memory leak in netstat

Jiří Popelka jpopelka at fedoraproject.org
Thu Sep 16 09:45:25 UTC 2010


commit 3385b912589f1b990976f0f2b8fbb90a33aa29f5
Author: Jiri Popelka <jpopelka at redhat.com>
Date:   Thu Sep 16 11:43:34 2010 +0200

    fixed memory leak in netstat

 net-tools-1.60-netstat-leak.patch |   11 +++++++++++
 net-tools.spec                    |    9 ++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/net-tools-1.60-netstat-leak.patch b/net-tools-1.60-netstat-leak.patch
new file mode 100644
index 0000000..6417f76
--- /dev/null
+++ b/net-tools-1.60-netstat-leak.patch
@@ -0,0 +1,11 @@
+diff -up net-tools-1.60/netstat.c.netstat-leak net-tools-1.60/netstat.c
+--- net-tools-1.60/netstat.c.netstat-leak	2010-09-16 10:49:49.000000000 +0200
++++ net-tools-1.60/netstat.c	2010-09-16 10:53:47.000000000 +0200
+@@ -558,6 +558,7 @@ static void tcp_node_hash_clear(void)
+       }
+ 
+       /* free the bucket itself */
++      free(tcp_node_hash[i]->socket_pair);
+       free(tcp_node_hash[i]);
+       tcp_node_hash[i] = NULL;
+     }
diff --git a/net-tools.spec b/net-tools.spec
index b8eecff..c270cab 100644
--- a/net-tools.spec
+++ b/net-tools.spec
@@ -1,7 +1,7 @@
 Summary: Basic networking tools
 Name: net-tools
 Version: 1.60
-Release: 104%{?dist}
+Release: 105%{?dist}
 License: GPL+
 Group: System Environment/Base
 URL: http://net-tools.berlios.de/
@@ -130,6 +130,9 @@ Patch86: net-tools-1.60-statistics-doubleword.patch
 # update mii-tool to support gigabit links (#539575)
 Patch87: net-tools-1.60-mii-gigabit.patch
 
+# fix memory leak in netstat when run with -c option
+Patch88: net-tools-1.60-netstat-leak.patch
+
 BuildRequires: gettext, libselinux
 BuildRequires: libselinux-devel
 Requires: hostname
@@ -222,6 +225,7 @@ Most of them are obsolete. For replacement check iproute package.
 %patch85 -p1 -b .large-indexes
 %patch86 -p1 -b .doubleword
 %patch87 -p1 -b .mii-gigabit
+%patch88 -p1 -b .netstat-leak
 
 cp %SOURCE1 ./config.h
 cp %SOURCE2 ./config.make
@@ -321,6 +325,9 @@ rm -rf %{buildroot}
 %config(noreplace) %{_sysconfdir}/ethers
 
 %changelog
+* Thu Sep 16 2010  Jiri Popelka <jpopelka at redhat.com> - 1.60-105
+- fixed memory leak in netstat when run with -c option
+
 * Tue Aug 10 2010  Jiri Popelka <jpopelka at redhat.com> - 1.60-104
 - improved statistics-doubleword.patch (Bug #579854)
 


More information about the scm-commits mailing list