diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-06-13 10:29:45 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 2000-06-13 10:29:45 +0000 |
commit | be21e71b1420f97ca1b80cf56d79a46261738223 (patch) | |
tree | 9f8e220d1cee110ccfcbb85a96df484f1cba76b5 | |
parent | 879d65894949dc7e3d918402dc48a5d18d7d47f7 (diff) |
avoid mbuf leak on non-matching ifp/sockaddr
-rw-r--r-- | sys/netinet/udp_usrreq.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index fe232f14a9d..e268cf214ea 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp_usrreq.c,v 1.42 2000/06/13 10:26:43 itojun Exp $ */ +/* $OpenBSD: udp_usrreq.c,v 1.43 2000/06/13 10:29:44 itojun Exp $ */ /* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ /* @@ -876,8 +876,10 @@ udp_output(m, va_alist) tmp.sin6_addr = inp->inp_faddr6; } /* KAME hack: embed scopeid */ - if (in6_embedscope(&ipv6->ip6_dst, &tmp, inp, &oifp) != 0) - return EINVAL; + if (in6_embedscope(&ipv6->ip6_dst, &tmp, inp, &oifp) != 0) { + error = EINVAL; + goto release; + } ipv6->ip6_hlim = in6_selecthlim(inp, oifp); if (sin6) { /*XXX*/ |