Fix a mbuf leak where sc_start fails or the protocol is none.

This commit is contained in:
thompsa 2007-05-19 01:40:18 +00:00
parent 1b488024ac
commit cbd790c8d2

View File

@ -1044,12 +1044,14 @@ lagg_start(struct ifnet *ifp)
if (sc->sc_proto != LAGG_PROTO_NONE)
error = (*sc->sc_start)(sc, m);
else
m_free(m);
m_freem(m);
if (error == 0)
ifp->if_opackets++;
else
else {
m_freem(m); /* sc_start failed */
ifp->if_oerrors++;
}
}
LAGG_RUNLOCK(sc);