aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2000-11-21 15:35:45 +0000
committerDaniel Stenberg <daniel@haxx.se>2000-11-21 15:35:45 +0000
commitc06f72661447a897d66ee18826044111df7f428e (patch)
tree6043654ceea4cfb3615b966a1331592137064e1c
parent52909688cfd78915665e451dd5b1dd83864aaf5f (diff)
GetHost() now sets the third pointer to NULL when the lookup fails, as the
memory is then freed in the function
-rw-r--r--lib/hostip.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/hostip.c b/lib/hostip.c
index 89ac57462..dc2ed0aec 100644
--- a/lib/hostip.c
+++ b/lib/hostip.c
@@ -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
}