make sure we free rangeline before we re-assign it to a new allocated

memory as otherwise we (might) leak memory
This commit is contained in:
Daniel Stenberg 2002-09-25 12:47:38 +00:00
parent e399502c7a
commit 969217c9d9
1 changed files with 3 additions and 0 deletions

View File

@ -669,6 +669,9 @@ CURLcode Curl_http(struct connectdata *conn)
*/
if((data->set.httpreq == HTTPREQ_GET) &&
!checkheaders(data, "Range:")) {
/* if a line like this was already allocated, free the previous one */
if(conn->allocptr.rangeline)
free(conn->allocptr.rangeline);
conn->allocptr.rangeline = aprintf("Range: bytes=%s\r\n", conn->range);
}
else if((data->set.httpreq != HTTPREQ_GET) &&