Date: Wed, 18 Dec 2019 18:50:16 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 242712] Networking device detach leaks memory Message-ID: <bug-242712-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242712 Bug ID: 242712 Summary: Networking device detach leaks memory Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: ghuckriede@blackberry.com Created attachment 210040 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=210040&action=edit before and after test results A free() appears to have been removed by mistake. line 1544 of https://svnweb.freebsd.org/base/head/sys/net/if.c?annotate=334117 was removed by the following submission: https://svnweb.freebsd.org/base/head/sys/net/if.c?revision=334118&view=markup This introduced a memory leak when calling if_delgroups(), as the malloc is still present in if_addgroup() on line 1458 of https://svnweb.freebsd.org/base/head/sys/net/if.c?annotate=355070 Furthermore the free() is present for if_delgroup() on line 1551 of https://svnweb.freebsd.org/base/head/sys/net/if.c?annotate=355070 Here is a fix along with a white space change. svn diff sys/net/if.c Index: sys/net/if.c =================================================================== --- sys/net/if.c (revision 355854) +++ sys/net/if.c (working copy) @@ -1594,9 +1594,10 @@ free(ifgm, M_TEMP); if (ifglfree) { EVENTHANDLER_INVOKE(group_detach_event, - ifgl->ifgl_group); + ifgl->ifgl_group); free(ifgl->ifgl_group, M_TEMP); } + free(ifgl, M_TEMP); EVENTHANDLER_INVOKE(group_change_event, groupname); IFNET_WLOCK(); -- You are receiving this mail because: You are the assignee for the bug.help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-242712-227>
