kern_rctl: Fix resource leak in error path

Ordinarily, rctl_write_outbuf frees 'sb'.  However, if we are in low memory
conditions we skip past the rctl_write_outbuf.  In that case, free 'sb'.

Reported by:	Coverity
CID:		1338539
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
Conrad Meyer 2016-04-20 02:09:38 +00:00
parent 856d8ddbb3
commit b483e111c4

View File

@ -1866,6 +1866,7 @@ sys_rctl_get_limits(struct thread *td, struct rctl_get_limits_args *uap)
RCTL_RUNLOCK();
if (sbuf_error(sb) == ENOMEM) {
error = ERANGE;
sbuf_delete(sb);
goto out;
}