ports/78807: net-mgmt/net-snmp: memory leak

Andriy Gapon avg at icyb.net.ua
Mon Mar 14 10:10:03 UTC 2005


>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:



More information about the freebsd-ports-bugs mailing list