Skip to content

Commit 9037ea3

Browse files
committed
decompressors: fix leak in lzma error case
Ticket: 7766
1 parent 79f88e6 commit 9037ea3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

htp/htp_decompressors.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ htp_status_t htp_gzip_decompressor_decompress(htp_decompressor_t *drec1, htp_tx_
350350
// There is data even if there is an error
351351
// So use this data and log a warning
352352
htp_log(d->tx->connp, HTP_LOG_MARK, HTP_LOG_WARNING, 0, "GZip decompressor: inflate failed with %d", rc);
353+
if (drec->zlib_initialized == HTP_COMPRESSION_LZMA) {
354+
LzmaDec_Free(&drec->state, &lzma_Alloc);
355+
}
353356
drec->zlib_initialized = HTP_COMPRESSION_OVER;
354357
return HTP_ERROR;
355358
}

0 commit comments

Comments
 (0)