From 242a17b9e0e430ba5933f7b2ae5586233ec35f33 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 11 May 2009 09:55:28 +0000 Subject: - Balint Szilakszi reported a memory leak when libcurl did gzip decompression of streams that had some parts (legitimately) missing. We now provide and use a proper cleanup function for the content encoding submodule. http://curl.haxx.se/mail/lib-2009-05/0092.html --- lib/content_encoding.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/content_encoding.c') diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 411f21337..08cf1dccc 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -414,4 +414,14 @@ Curl_unencode_gzip_write(struct connectdata *conn, return inflate_stream(conn, k); #endif } + +void Curl_unencode_cleanup(struct connectdata *conn) +{ + struct SessionHandle *data = conn->data; + struct SingleRequest *k = &data->req; + z_stream *z = &k->z; + if(k->zlib_init != ZLIB_UNINIT) + (void) exit_zlib(z, &k->zlib_init, CURLE_OK); +} + #endif /* HAVE_LIBZ */ -- cgit v1.2.3