diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2000-12-02 00:40:57 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2000-12-02 00:40:57 +0000 |
commit | e91e9907ef79a1f04320b63f9388ad93917a6b84 (patch) | |
tree | 9b9e0831c53ab059f2abfd946201634f066d5d71 /sys/kern/uipc_syscalls.c | |
parent | 2b0e48c014b3752cb18b4108f2857f52c32094a7 (diff) | |
download | FreeBSD-src-e91e9907ef79a1f04320b63f9388ad93917a6b84.zip FreeBSD-src-e91e9907ef79a1f04320b63f9388ad93917a6b84.tar.gz |
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)
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r-- | sys/kern/uipc_syscalls.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } /* |