lib/fetch/common.c: fix CID 284959 (NULL returns).

Also fix previous CID.
This commit is contained in:
Juan RP 2020-04-19 11:53:28 +02:00
parent 359721baa6
commit 8663c3bd75
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368

View File

@ -764,7 +764,6 @@ fetch_connect(struct url *url, int af, int verbose)
}
conn->cache_url = fetchCopyURL(url);
conn->cache_af = af;
fetchFreeURL(socks_url);
return (conn);
}
@ -1071,7 +1070,10 @@ fetch_ssl_get_numeric_addrinfo(const char *hostname, size_t len)
struct addrinfo hints, *res;
char *host;
host = (char *)malloc(len + 1);
host = malloc(len + 1);
if (!host)
return NULL;
memcpy(host, hostname, len);
host[len] = '\0';
memset(&hints, 0, sizeof(hints));