diff options
author | Daniel Stenberg <daniel@haxx.se> | 2000-11-21 15:36:38 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2000-11-21 15:36:38 +0000 |
commit | 2a5e68ea895136168dd6d0d753299e9b04fd85a1 (patch) | |
tree | c93c7969373b382df6fd5077bcd92e7b760459a9 /lib | |
parent | c06f72661447a897d66ee18826044111df7f428e (diff) |
added some defensive code around the GetHost()'s third argument result
Diffstat (limited to 'lib')
-rw-r--r-- | lib/url.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1312,7 +1312,7 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect) if (data->device && (strlen(data->device)<255)) { struct sockaddr_in sa; struct hostent *h=NULL; - char *hostdataptr; + char *hostdataptr=NULL; size_t size; char myhost[256] = ""; unsigned long in; @@ -1425,7 +1425,8 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect) return CURLE_HTTP_PORT_FAILED; } - free(hostdataptr); /* allocated by GetHost() */ + if(hostdataptr) + free(hostdataptr); /* allocated by GetHost() */ } /* end of device selection support */ #endif /* end of HAVE_INET_NTOA */ |