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
This commit is contained in:
Enji Cooper 2017-03-13 17:05:49 +00:00
parent e3e94c963e
commit 6c5b1b394d

View File

@ -512,6 +512,7 @@ parse_client_lease_statement(FILE *cfile, int is_static)
token = peek_token(&val, cfile);
if (token == EOF) {
parse_warn("unterminated lease declaration.");
free_client_lease(lease);
return;
}
if (token == RBRACE)