summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2008-08-08 08:54:09 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2008-08-08 08:54:09 +0000
commit5451e6861b3f8e9f76225950a1e00d3a94e8e145 (patch)
tree954d4ed3199936848319a8ef5904f3d601962ab8 /sys
parent924a7ff7faa7300916e6bb1bc330a2ab4abd69f4 (diff)
plug an mbuf leak in m_pullup2(); If we fail to get a cluster for an mbuf,
free the mbuf before bailing out. ok claudio@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_mbuf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index ad034e8491e..64258a31c8f 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.90 2008/06/11 02:46:34 henning Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.91 2008/08/08 08:54:08 thib Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -715,8 +715,10 @@ m_pullup2(struct mbuf *n, int len)
if (m == NULL)
goto bad;
MCLGET(m, M_DONTWAIT);
- if ((m->m_flags & M_EXT) == 0)
+ if ((m->m_flags & M_EXT) == 0) {
+ m_free(m);
goto bad;
+ }
m->m_len = 0;
if (n->m_flags & M_PKTHDR) {
/* Too many adverse side effects. */