Date: Wed, 20 Apr 2016 02:09:38 +0000 (UTC) From: "Conrad E. Meyer" <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298330 - head/sys/kern Message-ID: <201604200209.u3K29cpR040225@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cem Date: Wed Apr 20 02:09:38 2016 New Revision: 298330 URL: https://svnweb.freebsd.org/changeset/base/298330 Log: 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 Modified: head/sys/kern/kern_rctl.c Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Wed Apr 20 02:01:45 2016 (r298329) +++ head/sys/kern/kern_rctl.c Wed Apr 20 02:09:38 2016 (r298330) @@ -1866,6 +1866,7 @@ sys_rctl_get_limits(struct thread *td, s RCTL_RUNLOCK(); if (sbuf_error(sb) == ENOMEM) { error = ERANGE; + sbuf_delete(sb); goto out; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604200209.u3K29cpR040225>