Commit 969217c9 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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

memory as otherwise we (might) leak memory
parent e399502c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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) &&