svn commit: r315199 - head/sbin/dhclient
Ngie Cooper
ngie at FreeBSD.org
Mon Mar 13 17:05:51 UTC 2017
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 at 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)
More information about the svn-src-all
mailing list