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)
This commit is contained in:
bmilekic 2000-12-02 00:40:57 +00:00
parent 2b0e48c014
commit e91e9907ef

View File

@ -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;
}
/*