#175 http compress destroy mem leak

This commit is contained in:
luwenpeng
2019-09-26 15:37:02 +08:00
parent 7bffff1444
commit 8d29fe5cbc

View File

@@ -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)
{
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);
}