Author: pho
Date: Sun Apr 8 16:26:26 2012
New Revision: 234037
URL: http://svn.freebsd.org/changeset/base/234037
Log:
MFC: r232860
Allways call fdrop().
Modified:
stable/9/sys/kern/sys_capability.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/kern/sys_capability.c
==============================================================================
--- stable/9/sys/kern/sys_capability.c Sun Apr 8 13:44:55 2012
(r234036)
+++ stable/9/sys/kern/sys_capability.c Sun Apr 8 16:26:26 2012
(r234037)
@@ -253,16 +253,14 @@ sys_cap_new(struct thread *td, struct ca
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);
}
/*
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "[email protected]"