Skip to content
Snippets Groups Projects
Commit fefc7ea6 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

a memory leak when name lookup failed is now removed

parent d2203896
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment