Date: Wed, 20 Apr 2016 02:01:45 +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: r298329 - head/sys/net Message-ID: <201604200201.u3K21jUc039926@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cem Date: Wed Apr 20 02:01:45 2016 New Revision: 298329 URL: https://svnweb.freebsd.org/changeset/base/298329 Log: radix rn_inithead: Fix minor leak in low memory conditions R_Zalloc is essentially a malloc(M_NOWAIT) wrapper. It is possible that 'rnh' failed to allocate, but 'rmh' succeeds. In that case, we bail out of rn_inithead() but previously did not free 'rmh'. Introduced in r287073 (projects/routing) / MFP r294706. Reported by: Coverity CID: 1350258 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/net/radix.c Modified: head/sys/net/radix.c ============================================================================== --- head/sys/net/radix.c Wed Apr 20 01:39:31 2016 (r298328) +++ head/sys/net/radix.c Wed Apr 20 02:01:45 2016 (r298329) @@ -1156,6 +1156,8 @@ rn_inithead(void **head, int off) if (rnh == NULL || rmh == NULL) { if (rnh != NULL) R_Free(rnh); + if (rmh != NULL) + R_Free(rmh); return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604200201.u3K21jUc039926>