sbin/dhclient: fix vendor
storage leak in parse_option_decl(..)
This ensures the storage isn't leaked when non-NULL and the function returns early, prior to the `free(vendor)` later on in the function. MFC after: 1 week Reported by: Coverity CID: 1007111-1007113 Reviewed by: cem Sponsored by: Dell EMC Isilon Differential Revision: D9993
This commit is contained in:
parent
87b3dc5107
commit
7e431900a5
@ -714,6 +714,7 @@ parse_option_decl(FILE *cfile, struct option_data *options)
|
||||
parse_warn("expecting identifier after '.'");
|
||||
if (token != SEMI)
|
||||
skip_to_semi(cfile);
|
||||
free(vendor);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@ -726,6 +727,7 @@ parse_option_decl(FILE *cfile, struct option_data *options)
|
||||
if (!universe) {
|
||||
parse_warn("no vendor named %s.", vendor);
|
||||
skip_to_semi(cfile);
|
||||
free(vendor);
|
||||
return (NULL);
|
||||
}
|
||||
} else {
|
||||
@ -747,6 +749,7 @@ parse_option_decl(FILE *cfile, struct option_data *options)
|
||||
parse_warn("no option named %s for vendor %s",
|
||||
val, vendor);
|
||||
skip_to_semi(cfile);
|
||||
free(vendor);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user