diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2004-02-10 20:20:02 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2004-02-10 20:20:02 +0000 |
commit | acc96c29c62035d38bea930d9f6669be56064bdd (patch) | |
tree | c0e770f443b9b17cb622102ac6468aa461c5d362 /sys/net | |
parent | 059f45599ccaca843e9879cc92e16655bec5ff62 (diff) |
plug mbuf leak (ip_fragment() always free mbuf on error). tested by cedric,
dhartmei ok
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_bridge.c | 6 | ||||
-rw-r--r-- | sys/net/pf.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c index 4488fea6da0..f2798157ea2 100644 --- a/sys/net/if_bridge.c +++ b/sys/net/if_bridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bridge.c,v 1.130 2004/02/02 19:56:23 cedric Exp $ */ +/* $OpenBSD: if_bridge.c,v 1.131 2004/02/10 20:20:01 itojun Exp $ */ /* * Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net) @@ -2577,8 +2577,10 @@ bridge_fragment(struct bridge_softc *sc, struct ifnet *ifp, } error = ip_fragment(m, ifp, ifp->if_mtu); - if (error) + if (error) { + m = NULL; goto dropit; + } for (; m; m = m0) { m0 = m->m_nextpkt; diff --git a/sys/net/pf.c b/sys/net/pf.c index 4d2ab09b455..2ff09f04c04 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.422 2004/02/10 18:49:10 henning Exp $ */ +/* $OpenBSD: pf.c,v 1.423 2004/02/10 20:20:01 itojun Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -5006,8 +5006,10 @@ pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp, m1 = m0; error = ip_fragment(m0, ifp, ifp->if_mtu); - if (error) + if (error) { + m0 = NULL; goto bad; + } for (m0 = m1; m0; m0 = m1) { m1 = m0->m_nextpkt; |