Allways call fdrop().

This commit is contained in:
Peter Holm 2012-03-12 11:56:57 +00:00
parent 3c5b7c6fb9
commit 62a9fc76df

View file

@ -261,16 +261,14 @@ sys_cap_new(struct thread *td, struct cap_new_args *uap)
return (error);
AUDIT_ARG_FILE(td->td_proc, fp);
error = kern_capwrap(td, fp, rights, &capfd);
if (error)
return (error);
/*
* Release our reference to the file (kern_capwrap has held a reference
* for the filedesc array).
*/
fdrop(fp, td);
td->td_retval[0] = capfd;
return (0);
if (error == 0)
td->td_retval[0] = capfd;
return (error);
}
/*