diff options
author | Jiri Popelka <jpopelka@redhat.com> | 2012-06-29 10:04:58 +0200 |
---|---|---|
committer | Jiri Popelka <jpopelka@redhat.com> | 2012-06-29 17:42:48 +0200 |
commit | e8b37a8407f053bfbf378df3bd8d94cf1e71f7b8 (patch) | |
tree | ed2f3b305e07a07b0aa3f76ee00b43b6f1a18269 | |
parent | 992a1def36ca8518f740ee8f23af1cc569ab2fef (diff) | |
download | net-tools-e8b37a8407f053bfbf378df3bd8d94cf1e71f7b8.tar.gz net-tools-e8b37a8407f053bfbf378df3bd8d94cf1e71f7b8.tar.bz2 net-tools-e8b37a8407f053bfbf378df3bd8d94cf1e71f7b8.zip |
netstat memory leak fixed.
valgrind --leak-check=full netstat
(x86_64)
before:
definitely lost: 1,536 bytes in 64 blocks
indirectly lost: 479 bytes in 64 blocks
ERROR SUMMARY: 1 errors from 1 contexts
after:
definitely lost: 0 bytes in 0 blocks
indirectly lost: 0 bytes in 0 blocks
ERROR SUMMARY: 0 errors from 0 contexts
-rw-r--r-- | lib/inet.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -396,6 +396,9 @@ static int read_services(void) add2list(&udp_name, item); } else if (!strcmp(se->s_proto, "raw")) { add2list(&raw_name, item); + } else { /* sctp, ddp, dccp */ + free(item->name); + free(item); } } endservent(); |