From 683fa2b5d798483091b9b3b39c1078673ee197af Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Tue, 10 Jul 2012 13:17:32 +0000 Subject: [PATCH] Plug potential mbuf leak when bridging fragments If an error occurs when transmitting one mbuf in a chain of fragments, free the subsequent fragments instead of leaking them. Sponsored by: ADARA Networks --- sys/net/if_bridge.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index fd60bf2143dc..7a57e9c89b98 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1813,6 +1813,8 @@ bridge_enqueue(struct bridge_softc *sc, struct ifnet *dst_ifp, struct mbuf *m) if (err == 0) err = dst_ifp->if_transmit(dst_ifp, m); + else + m_freem(m); } if (err == 0) {