From 6c6971a530610bfa8274b01d8eaa28446e72c0ae Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Tue, 24 Jun 2025 03:49:42 -0700 Subject: [PATCH] Bug Fix: Fix potential memory leak Signed-off-by: Christopher Snowhill --- Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm b/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm index e8c3ec085..a32796819 100644 --- a/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm +++ b/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm @@ -756,8 +756,10 @@ static int load_twosf_mapz(struct twosf_loader_state *state, int issave, const u { uLong ccrc = crc32(crc32(0L, Z_NULL, 0), rdata, (uInt)usize); - if(ccrc != zcrc) + if(ccrc != zcrc) { + free(rdata); return -1; + } } ret = load_twosf_map(state, issave, rdata, (unsigned)usize);