summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluwenpeng <[email protected]>2019-09-26 15:37:02 +0800
committerluwenpeng <[email protected]>2019-09-26 15:38:34 +0800
commit8d29fe5cbc2b17490cd41065904e46bcfa373e6a (patch)
treed0b4a8311995314df2b525c782a85c6b10aacb7e
parent7bffff1444648f65e7a85707c5f3fa8ec22deee2 (diff)
#175 http compress destroy mem leakv4.1.5-20190926
-rw-r--r--plugin/protocol/http/src/http_convert.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugin/protocol/http/src/http_convert.cpp b/plugin/protocol/http/src/http_convert.cpp
index 8e82070..89874ae 100644
--- a/plugin/protocol/http/src/http_convert.cpp
+++ b/plugin/protocol/http/src/http_convert.cpp
@@ -392,8 +392,15 @@ int hf_content_compress_write(struct hf_content_compress * cv_object,
void hf_content_compress_destroy(hf_content_compress * cv_object)
{
- (void) deflateEnd(cv_object->z_stream_ptr);
- free(cv_object->z_stream_ptr);
- cv_object->z_stream_ptr = NULL;
+ if (cv_object->brenc_state) {
+ BrotliEncoderDestroyInstance(cv_object->brenc_state);
+ cv_object->brenc_state = NULL;
+ }
+
+ if (cv_object->z_stream_ptr) {
+ (void) deflateEnd(cv_object->z_stream_ptr);
+ free(cv_object->z_stream_ptr);
+ cv_object->z_stream_ptr = NULL;
+ }
free(cv_object);
}