fetch/common.c: fix a memleak found by clang-analyzer.
This commit is contained in:
parent
68d84d89c1
commit
9e524d831c
@ -640,8 +640,10 @@ fetch_ssl_get_numeric_addrinfo(const char *hostname, size_t len)
|
|||||||
hints.ai_protocol = 0;
|
hints.ai_protocol = 0;
|
||||||
hints.ai_flags = AI_NUMERICHOST;
|
hints.ai_flags = AI_NUMERICHOST;
|
||||||
/* port is not relevant for this purpose */
|
/* port is not relevant for this purpose */
|
||||||
if (getaddrinfo(host, "443", &hints, &res) != 0)
|
if (getaddrinfo(host, "443", &hints, &res) != 0) {
|
||||||
|
free(host);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
free(host);
|
free(host);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user