aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-11-02 22:34:41 +0100
committerYang Tse <yangsita@gmail.com>2011-11-02 22:34:41 +0100
commit6bdeca967d0c449fe379c56dda75b0d236f39780 (patch)
tree1dd0e7eec71855e3b6e7c7494809f3090e2e5723 /lib/transfer.c
parent3f5e267b9d11c043168d5323f493f51fb73fb15d (diff)
url.c and transfer.c: nullify connection pointer when free()'ed
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 413a28082..e56fffd7b 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1991,12 +1991,17 @@ connect_host(struct SessionHandle *data,
/* Now, if async is TRUE here, we need to wait for the name
to resolve */
res = Curl_resolver_wait_resolv(*conn, NULL);
- if(CURLE_OK == res)
+ if(CURLE_OK == res) {
/* Resolved, continue with the connection */
res = Curl_async_resolved(*conn, &protocol_done);
- else
+ if(res)
+ *conn = NULL;
+ }
+ else {
/* if we can't resolve, we kill this "connection" now */
(void)Curl_disconnect(*conn, /* dead_connection */ FALSE);
+ *conn = NULL;
+ }
}
return res;