From: Daniel Stenberg Date: Wed, 25 Sep 2002 12:47:38 +0000 (+0000) Subject: make sure we free rangeline before we re-assign it to a new allocated X-Git-Tag: curl-7_10~14 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=969217c9d9a25cb75d26f815e43f5748b9891f2c;p=thirdparty%2Fcurl.git make sure we free rangeline before we re-assign it to a new allocated memory as otherwise we (might) leak memory --- diff --git a/lib/http.c b/lib/http.c index 855d74733a..6bba43dda4 100644 --- a/lib/http.c +++ b/lib/http.c @@ -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) &&