From d8f3dc78717ce8610f8c9c652392d07a911cf50c Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Fri, 16 Oct 2015 14:55:39 +0000 Subject: [PATCH] If falloc_caps() failed, cleanup needs to be performed. This is a bug in r289026. Sponsored by: The FreeBSD Foundation --- sys/kern/kern_fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 0e28072f010f..bb35b9b25d8f 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -848,7 +848,7 @@ fork1(struct thread *td, int flags, int pages, struct proc **procp, if (flags & RFPROCDESC) { error = falloc_caps(td, &fp_procdesc, procdescp, 0, fcaps); if (error != 0) - return (error); + goto fail2; } mem_charged = 0;