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

GetHost() now sets the third pointer to NULL when the lookup fails, as the

memory is then freed in the function
parent 52909688
No related branches found
No related tags found
No related merge requests found
......@@ -187,12 +187,14 @@ struct hostent *GetHost(struct UrlData *data,
infof(data, "gethostbyname_r(2) failed for %s\n", hostname);
h = NULL; /* set return code to NULL */
free(buf);
*bufp=NULL;
}
#else
else {
if ((h = gethostbyname(hostname)) == NULL ) {
infof(data, "gethostbyname(2) failed for %s\n", hostname);
free(buf);
*bufp=NULL;
}
#endif
}
......
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