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 */
|
/* Create a new cache entry */
|
||||||
p = (struct curl_dns_cache_entry *) malloc(sizeof(struct curl_dns_cache_entry));
|
p = (struct curl_dns_cache_entry *)
|
||||||
if (!p) {
|
malloc(sizeof(struct curl_dns_cache_entry));
|
||||||
|
if (!p)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
p->addr = Curl_getaddrinfo(data, hostname, port, bufp);
|
p->addr = Curl_getaddrinfo(data, hostname, port, bufp);
|
||||||
if (!p->addr) {
|
if (!p->addr) {
|
||||||
|
free(p);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
p->timestamp = now;
|
p->timestamp = now;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user