mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-24 11:29:10 +00:00
nv_malloc can fail in userland.
Add check to prevent a NULL pointer dereference. Pointed out by: mjg Approved by: pjd (mentor)
This commit is contained in:
parent
da20d06f84
commit
a523fa069f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=282350
@ -129,6 +129,8 @@ nvlist_create(int flags)
|
||||
PJDLOG_ASSERT((flags & ~(NV_FLAG_PUBLIC_MASK)) == 0);
|
||||
|
||||
nvl = nv_malloc(sizeof(*nvl));
|
||||
if (nvl == NULL)
|
||||
return (NULL);
|
||||
nvl->nvl_error = 0;
|
||||
nvl->nvl_flags = flags;
|
||||
nvl->nvl_parent = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user