diff options
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -2852,6 +2852,9 @@ static CURLcode CreateConnection(struct SessionHandle *data, Curl_safefree(old_conn->proxyuser); Curl_safefree(old_conn->proxypasswd); + if(old_conn->bits.rangestringalloc) + free(old_conn->range); + free(old_conn); /* we don't need this anymore */ /* @@ -2860,14 +2863,14 @@ static CURLcode CreateConnection(struct SessionHandle *data, */ conn->resume_from = data->set.set_resume_from; if (conn->resume_from) { - snprintf(resumerange, sizeof(resumerange), "%d-", conn->resume_from); - if (conn->bits.rangestringalloc == TRUE) - free(conn->range); - - /* tell ourselves to fetch this range */ - conn->range = strdup(resumerange); - conn->bits.use_range = TRUE; /* enable range download */ - conn->bits.rangestringalloc = TRUE; /* mark range string allocated */ + snprintf(resumerange, sizeof(resumerange), "%d-", conn->resume_from); + if (conn->bits.rangestringalloc == TRUE) + free(conn->range); + + /* tell ourselves to fetch this range */ + conn->range = strdup(resumerange); + conn->bits.use_range = TRUE; /* enable range download */ + conn->bits.rangestringalloc = TRUE; /* mark range string allocated */ } else if (data->set.set_range) { /* There is a range, but is not a resume, useful for random ftp access */ |