summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-09-25 12:47:38 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-09-25 12:47:38 +0000
commit969217c9d9a25cb75d26f815e43f5748b9891f2c (patch)
tree9f0f38af4b753f99d2460320c7858237b040a8e8
parente399502c7adc958ff20bd68242a5cf867c0dee5f (diff)
downloadgnurl-969217c9d9a25cb75d26f815e43f5748b9891f2c.tar.gz
gnurl-969217c9d9a25cb75d26f815e43f5748b9891f2c.tar.bz2
gnurl-969217c9d9a25cb75d26f815e43f5748b9891f2c.zip
make sure we free rangeline before we re-assign it to a new allocated
memory as otherwise we (might) leak memory
-rw-r--r--lib/http.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/http.c b/lib/http.c
index 855d74733..6bba43dda 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) &&