summaryrefslogtreecommitdiff
path: root/lib/content_encoding.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-02-14 09:09:09 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-02-14 09:09:09 +0000
commitd315d41a12b3273b258ea7823b73c3c7bab3a4e9 (patch)
tree63ea1f4894defc58002a2e638dacbb9e7243749a /lib/content_encoding.c
parent4f7687895d243e4be369538449516e761b26a211 (diff)
downloadcurl-d315d41a12b3273b258ea7823b73c3c7bab3a4e9.tar.gz
- Andre Guibert de Bruet found and fixed a memory leak in the content encoding
code, which could happen on libz errors.
Diffstat (limited to 'lib/content_encoding.c')
-rw-r--r--lib/content_encoding.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/content_encoding.c b/lib/content_encoding.c
index 9cd5b0734..0de1c15d6 100644
--- a/lib/content_encoding.c
+++ b/lib/content_encoding.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2007, 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -133,8 +133,9 @@ inflate_stream(struct connectdata *conn,
/* some servers seem to not generate zlib headers, so this is an attempt
to fix and continue anyway */
- (void) inflateEnd(z); /* don't care about the return code */
+ (void) inflateEnd(z); /* don't care about the return code */
if(inflateInit2(z, -MAX_WBITS) != Z_OK) {
+ free(decomp);
return process_zlib_error(conn, z);
}
z->next_in = orig_in;