diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-04-03 10:20:23 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-04-03 10:20:23 +0000 |
commit | 28497e7ee40e8e2bf3c50f20c311bf9abff34ea6 (patch) | |
tree | 85bbe960cfe2dedad25122fab285a7d876ee55b1 /lib/url.c | |
parent | 87c7f403a9a6d1f57bc50a322ce506775ca25395 (diff) |
better error checks for failure conditions (based on Puneet Pawaia's reports)
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -816,6 +816,9 @@ CURLcode Curl_disconnect(struct connectdata *conn) free(conn->hostent_buf); #endif + if(conn->newurl) + free(conn->newurl); + if(conn->path) /* the URL path part */ free(conn->path); @@ -2147,8 +2150,10 @@ CURLcode Curl_connect(struct UrlData *data, /* We're not allowed to return failure with memory left allocated in the connectdata struct, free those here */ conn = (struct connectdata *)*in_connect; - if(conn) + if(conn) { Curl_disconnect(conn); /* close the connection */ + *in_connect = NULL; /* return a NULL */ + } } return code; } |