git: eac751c461d8 - stable/15 - kern_fork: guard against NULL newproc on the failure path
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 13 Jun 2026 01:03:57 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=eac751c461d89de2676cb98936a8cde9b3ad2beb
commit eac751c461d89de2676cb98936a8cde9b3ad2beb
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-06-10 10:29:05 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-06-13 00:58:37 +0000
kern_fork: guard against NULL newproc on the failure path
(cherry picked from commit 9b48646ab366dcf6089fac653eef963331aa1169)
---
sys/kern/kern_fork.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
index 83a3162d8cfb..558a231ed61d 100644
--- a/sys/kern/kern_fork.c
+++ b/sys/kern/kern_fork.c
@@ -1139,7 +1139,8 @@ fail1:
fail2:
if (vm2 != NULL)
vmspace_free(vm2);
- PROC_TREE_UNREF(newproc);
+ if (newproc != NULL)
+ PROC_TREE_UNREF(newproc);
if ((flags & RFPROCDESC) != 0 && fp_procdesc != NULL) {
fdclose(td, fp_procdesc, *fr->fr_pd_fd);
fdrop(fp_procdesc, td);