Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 May 2017 19:37:15 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 219072] net-mgmt/net-snmp: memory leak in swrun_kinfo.c
Message-ID:  <bug-219072-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D219072

            Bug ID: 219072
           Summary: net-mgmt/net-snmp: memory leak in swrun_kinfo.c
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: zi@FreeBSD.org
          Reporter: mwennrich@gmail.com
             Flags: maintainer-feedback?(zi@FreeBSD.org)
          Assignee: zi@FreeBSD.org

Created attachment 182305
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D182305&action=
=3Dedit
patch for agent/mibgroup/host/data_access/swrun_kinfo.c

agent/mibgroup/host/data_access/swrun_kinfo.c doesn't check the return code=
 of
CONTAINER_INSERT and leaks memory, if return code is "-1" (duplicate key)

        rc =3D CONTAINER_INSERT(container, entry);

(rc never gets checked)


This patch checks the return code and frees the allocated entry, if it didn=
't
get inserted because becaus it was a duplicate.

        if ( -1 =3D=3D CONTAINER_INSERT(container, entry)) {
          // entry didn't get inserted (duplicate key)
          free(entry);
        }


This resovles this memory leak.

See also upstream bug: https://sourceforge.net/p/net-snmp/bugs/2717/
and upstream submitted patch: https://sourceforge.net/p/net-snmp/patches/13=
41/

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-219072-13>