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:
parent
e3e94c963e
commit
6c5b1b394d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user