fetch/common.c: fix a memleak found by clang-analyzer.

This commit is contained in:
Juan RP 2015-12-21 17:12:14 +01:00
parent 68d84d89c1
commit 9e524d831c

View File

@ -640,8 +640,10 @@ fetch_ssl_get_numeric_addrinfo(const char *hostname, size_t len)
hints.ai_protocol = 0;
hints.ai_flags = AI_NUMERICHOST;
/* 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;
}
free(host);
return res;
}