Don't leak 'str' when we see a malformed IPv6 address.
MFC after: 2 weeks
This commit is contained in:
parent
1b34e69534
commit
203632f263
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=309241
@ -675,8 +675,10 @@ parse_addr_port(char *arg, const char *def_port, struct addrinfo **ai)
|
|||||||
*/
|
*/
|
||||||
arg++;
|
arg++;
|
||||||
addr = strsep(&arg, "]");
|
addr = strsep(&arg, "]");
|
||||||
if (arg == NULL)
|
if (arg == NULL) {
|
||||||
|
free(str);
|
||||||
return (1);
|
return (1);
|
||||||
|
}
|
||||||
if (arg[0] == '\0') {
|
if (arg[0] == '\0') {
|
||||||
port = def_port;
|
port = def_port;
|
||||||
} else if (arg[0] == ':') {
|
} else if (arg[0] == ':') {
|
||||||
|
Loading…
Reference in New Issue
Block a user