summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordwmalone <dwmalone@FreeBSD.org>2001-06-24 12:27:30 +0000
committerdwmalone <dwmalone@FreeBSD.org>2001-06-24 12:27:30 +0000
commit79a843a087e9d1c4c34af48ebbe21596febcb594 (patch)
treef9a2c2ca7645fa786c05fe2865561bbe0bbd1200
parentfce7386c11b4c19abaf601c1c101bed2f13c09b7 (diff)
downloadFreeBSD-src-79a843a087e9d1c4c34af48ebbe21596febcb594.zip
FreeBSD-src-79a843a087e9d1c4c34af48ebbe21596febcb594.tar.gz
Don't dereference a NULL pointer if we fail to get a sendfilebuf.
-rw-r--r--sys/kern/uipc_syscalls.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 9426476..2718591 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1472,7 +1472,8 @@ sf_buf_alloc()
if (error)
break;
}
- SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list);
+ if (sf != NULL)
+ SLIST_REMOVE_HEAD(&sf_freelist.sf_head, free_list);
mtx_unlock(&sf_freelist.sf_lock);
return (sf);
}
OpenPOWER on IntegriCloud