mirror of
https://github.com/curl/curl.git
synced 2025-01-18 14:04:30 +08:00
a memory leak when name lookup failed is now removed
This commit is contained in:
parent
d220389647
commit
fefc7ea600
@ -131,13 +131,14 @@ Curl_addrinfo *Curl_resolv(struct SessionHandle *data,
|
||||
}
|
||||
|
||||
/* Create a new cache entry */
|
||||
p = (struct curl_dns_cache_entry *) malloc(sizeof(struct curl_dns_cache_entry));
|
||||
if (!p) {
|
||||
p = (struct curl_dns_cache_entry *)
|
||||
malloc(sizeof(struct curl_dns_cache_entry));
|
||||
if (!p)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p->addr = Curl_getaddrinfo(data, hostname, port, bufp);
|
||||
if (!p->addr) {
|
||||
free(p);
|
||||
return NULL;
|
||||
}
|
||||
p->timestamp = now;
|
||||
|
Loading…
Reference in New Issue
Block a user