diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2001-02-28 14:03:46 +0000 | 
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2001-02-28 14:03:46 +0000 | 
| commit | 9bc24e48768a25f308f8992ea4a671657279a9df (patch) | |
| tree | 1a96878e215909cb519022cbc2e6e04064f0111b /lib | |
| parent | 4af55809e4befb59bc341f5e6803aa80634c8fdb (diff) | |
cleanup better when connects fail
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/url.c | 10 | 
1 files changed, 10 insertions, 0 deletions
@@ -1737,7 +1737,12 @@ CURLcode curl_connect(CURL *curl, CURLconnect **in_connect)    if(CURLE_OK != code) {      /* We're not allowed to return failure with memory left allocated         in the connectdata struct, free those here */ +    struct UrlData *data; +    int index; +      conn = (struct connectdata *)*in_connect; +    data = conn->data; +#if 0      if(conn) {        if(conn->path)          free(conn->path); @@ -1751,6 +1756,11 @@ CURLcode curl_connect(CURL *curl, CURLconnect **in_connect)        free(conn);        *in_connect=NULL;      } +#endif +    index = conn->connectindex; /* get the index */ +    curl_disconnect(conn);      /* close the connection */ +    data->connects[index]=NULL; /* clear the pointer */ +    }    return code;  }  | 
