kern_fork: guard against NULL newproc on the failure path
Reported and tested by: pho
Fixes: 85a65e3930 ("proc: add tree ref count")
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
This commit is contained in:
@@ -1132,6 +1132,7 @@ fork1(struct thread *td, struct fork_req *fr)
|
||||
fail2:
|
||||
if (vm2 != NULL)
|
||||
vmspace_free(vm2);
|
||||
if (newproc != NULL)
|
||||
PROC_TREE_UNREF(newproc);
|
||||
if ((flags & RFPROCDESC) != 0 && fp_procdesc != NULL) {
|
||||
fdclose(td, fp_procdesc, *fr->fr_pd_fd);
|
||||
|
||||
Reference in New Issue
Block a user