hi,

this will plug another memleak by using m_freem() (free whole mbuf
chain) instead m_free() (free first mbuf only).

ok?

reyk

Index: net/if_trunk.c
===================================================================
RCS file: /cvs/src/sys/net/if_trunk.c,v
retrieving revision 1.76
diff -u -p -r1.76 if_trunk.c
--- net/if_trunk.c      12 Nov 2010 13:26:29 -0000      1.76
+++ net/if_trunk.c      28 Jan 2011 13:59:11 -0000
@@ -1515,7 +1515,7 @@ trunk_bcast_start(struct trunk_softc *tr
                        if (active_ports) {
                                n = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
                                if (n == NULL) {
-                                       m_free(m);
+                                       m_freem(m);
                                        return (ENOBUFS);
                                }
                        } else
@@ -1526,7 +1526,7 @@ trunk_bcast_start(struct trunk_softc *tr
                }
        }
        if (active_ports == 0) {
-               m_free(m);
+               m_freem(m);
                return (ENOENT);
        }
        if (errors == active_ports)

Reply via email to