mirror of
https://github.com/curl/curl.git
synced 2026-05-30 06:57:28 +03:00
GetHost() now sets the third pointer to NULL when the lookup fails, as the
memory is then freed in the function
This commit is contained in:
parent
52909688cf
commit
c06f726614
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue