Date: Mon, 13 Mar 2017 17:05:49 +0000 (UTC) From: Ngie Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315199 - head/sbin/dhclient Message-ID: <201703131705.v2DH5nLH050141@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Mon Mar 13 17:05:49 2017 New Revision: 315199 URL: https://svnweb.freebsd.org/changeset/base/315199 Log: sbin/dhclient: fix a memory leak in parse_client_lease_statement(..) The memory stored by `lease` would have previously been leaked if an unterminated lease declaration was found in an early-return code path. MFC after: 1 week Reported by: clang static analyzer, Coverity CID: 1007114 Submitted by: Tom Rix <trix@juniper.net> Sponsored by: Dell EMC Isilon; Juniper, Inc Differential Revision: D9992 Modified: head/sbin/dhclient/clparse.c Modified: head/sbin/dhclient/clparse.c ============================================================================== --- head/sbin/dhclient/clparse.c Mon Mar 13 16:44:06 2017 (r315198) +++ head/sbin/dhclient/clparse.c Mon Mar 13 17:05:49 2017 (r315199) @@ -512,6 +512,7 @@ parse_client_lease_statement(FILE *cfile token = peek_token(&val, cfile); if (token == EOF) { parse_warn("unterminated lease declaration."); + free_client_lease(lease); return; } if (token == RBRACE)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703131705.v2DH5nLH050141>