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:
parent
856d8ddbb3
commit
b483e111c4
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user