X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_encoding_api.c;h=9e0976c58d2b33c5511d80a88cd7b7f3e4b931f7;hp=c644d914dcfc2a9b77e2c289ae77ff62672c4a8e;hb=34c551d43ab4fbfff88a81e545a43fbbf7a8a75d;hpb=ea72d21d93fa8e5a1a21422b14e90e6c89af3d54 diff --git a/http_encoding_api.c b/http_encoding_api.c index c644d91..9e0976c 100644 --- a/http_encoding_api.c +++ b/http_encoding_api.c @@ -6,7 +6,7 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2007, Michael Wallner | + | Copyright (c) 2004-2010, Michael Wallner | +--------------------------------------------------------------------+ */ @@ -327,10 +327,13 @@ retry_raw_inflate: Z.avail_in = data_len; switch (status = http_inflate_rounds(&Z, Z_NO_FLUSH, decoded, decoded_len)) { - case Z_OK: case Z_STREAM_END: inflateEnd(&Z); return SUCCESS; + + case Z_OK: + status = Z_DATA_ERROR; + break; case Z_DATA_ERROR: /* raw deflated data? */ @@ -341,6 +344,10 @@ retry_raw_inflate: } } inflateEnd(&Z); + + if (decoded_len && *decoded) { + efree(*decoded); + } } http_error_ex(HE_WARNING, HTTP_E_ENCODING, "Could not inflate data: %s", zError(status));