From e91e9907ef79a1f04320b63f9388ad93917a6b84 Mon Sep 17 00:00:00 2001 From: bmilekic Date: Sat, 2 Dec 2000 00:40:57 +0000 Subject: Make sure to free the sf_buf if we've allocated it but fail to allocate an mbuf (ENOBUFS) before returning so that we don't leak sf_bufs in the case where we're out of mbufs. Submitted by: David Greenman (dg) --- sys/kern/uipc_syscalls.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/kern/uipc_syscalls.c') diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index fa6cb6a..a06b39f 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1705,6 +1705,7 @@ retry_lookup: MGETHDR(m, M_WAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; + sf_buf_free((void *)sf->kva, PAGE_SIZE); goto done; } /* -- cgit v1.1