cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Memory leak during gzip decompression

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 7 May 2009 20:21:43 +0200 (CEST)

On Thu, 7 May 2009, Balint Szilakszi wrote:

> When using libcurl to access some sites with CURLOPT_ENCODING set to "" and
> the site returning data with Content-Encoding: gzip, libcurl (or zlib) leaks
> memory.

Confirmed with current CVS HEAD:

$ valgrind ./src/curl --compressed
"http://search.live.com/results.aspx?go=&form=QBLH&q=%22james%22" -o /dev/null

Reports:

==27273== 42,292 (9,524 direct, 32,768 indirect) bytes in 1 blocks are
definitely lost in loss record 4 of 5
==27273== at 0x402601E: malloc (vg_replace_malloc.c:207)
==27273== by 0x4213E60: (within /usr/lib/libz.so.1.2.3.3)
==27273== by 0x4213FFD: inflateInit2_ (in /usr/lib/libz.so.1.2.3.3)
==27273== by 0x8081A74: Curl_unencode_gzip_write (content_encoding.c:284)
==27273== by 0x8080BB6: Curl_httpchunk_read (http_chunks.c:250)
==27273== by 0x807CFBF: readwrite_data (transfer.c:602)
==27273== by 0x807EF6C: Curl_readwrite (transfer.c:1682)
==27273== by 0x807F748: Transfer (transfer.c:1952)
==27273== by 0x808032D: Curl_perform (transfer.c:2574)
==27273== by 0x805C31B: curl_easy_perform (easy.c:541)
==27273== by 0x80546CC: operate (main.c:4872)
==27273== by 0x8054FAD: main (main.c:5175)
==27273==
==27273== LEAK SUMMARY:
==27273== definitely lost: 9,524 bytes in 1 blocks.
==27273== indirectly lost: 32,768 bytes in 1 blocks.
==27273== possibly lost: 0 bytes in 0 blocks.
==27273== still reachable: 2,416 bytes in 39 blocks.
==27273== suppressed: 0 bytes in 0 blocks.

-- 
  / daniel.haxx.se
Received on 2009-05-07