diff --git a/lib/hostip.c b/lib/hostip.c index 3db704f4454605455ae98858fadf11a97e5a5c1a..7bb8c966cc3b2fb98337a4fc2ed92fbca69a7992 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -378,9 +378,7 @@ int Curl_resolv(struct connectdata *conn, int wait; struct SessionHandle *data = conn->data; CURLcode result; - - /* default to failure */ - int rc = CURLRESOLV_ERROR; + int rc; *entry = NULL; #ifdef HAVE_SIGSETJMP @@ -413,6 +411,8 @@ int Curl_resolv(struct connectdata *conn, /* free the allocated entry_id again */ free(entry_id); + rc = CURLRESOLV_ERROR; /* default to failure */ + if (!dns) { /* The entry was not in the cache. Resolve it to IP address */