fixed memory leak in netstat

This commit is contained in:
Jiri Popelka 2010-09-16 11:43:34 +02:00
parent 803cb99a38
commit 3385b91258
2 changed files with 19 additions and 1 deletions

View File

@ -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;
}

View File

@ -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@redhat.com> - 1.60-105
- fixed memory leak in netstat when run with -c option
* Tue Aug 10 2010 Jiri Popelka <jpopelka@redhat.com> - 1.60-104
- improved statistics-doubleword.patch (Bug #579854)