Date: Mon, 14 Mar 2005 12:01:45 +0200 (EET) From: Andriy Gapon <avg@icyb.net.ua> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/78807: net-mgmt/net-snmp: memory leak Message-ID: <200503141001.j2EA1jc9039302@oddity.topspin.kiev.ua> Resent-Message-ID: <200503141010.j2EAA2B9086574@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 78807 >Category: ports >Synopsis: net-mgmt/net-snmp: memory leak >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 14 10:10:02 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Andriy Gapon >Release: FreeBSD 5.2.1-RELEASE-p13 i386 >Organization: >Environment: System: FreeBSD 5.2.1-RELEASE-p13 i386 net-snmp-5.2.1 from ports built with default options >Description: the problem is obvious from looking at the code and the attached patch - memory used by addr_string is not freed before re-assigning the varible. I am not sure about the exact circumstances that result in the problematic code path being taken, but if you see messages like this: Connection from <UNKNOWN> in your snmpd.log, you need this patch. >How-To-Repeat: if you see messages like this: Connection from <UNKNOWN> in your snmpd.log, then you should also see that snmpd size grows with time. >Fix: --- libwrap-unknown.patch begins here --- --- agent/snmp_agent.c.orig Wed Mar 9 17:03:15 2005 +++ agent/snmp_agent.c Wed Mar 9 17:19:12 2005 @@ -825,6 +825,7 @@ return 0; } } else { + SNMP_FREE(addr_string); if (hosts_ctl("snmpd", STRING_UNKNOWN, STRING_UNKNOWN, STRING_UNKNOWN)){ snmp_log(allow_severity, "Connection from <UNKNOWN>\n"); addr_string = strdup("<UNKNOWN>"); --- libwrap-unknown.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503141001.j2EA1jc9039302>