From d96409ff37c29cbdf21f12c90a7930113fbddc79 Mon Sep 17 00:00:00 2001 From: negativeExponent <54053706+negativeExponent@users.noreply.github.com> Date: Thu, 19 Dec 2019 04:44:34 +0800 Subject: [PATCH] Fix heap-use-after-free found when using asan Fix https://github.com/libretro/RetroArch/issues/9871 --- libretro-common/formats/libchdr/libchdr_lzma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretro-common/formats/libchdr/libchdr_lzma.c b/libretro-common/formats/libchdr/libchdr_lzma.c index 846ef8cd20..71602cc5b9 100644 --- a/libretro-common/formats/libchdr/libchdr_lzma.c +++ b/libretro-common/formats/libchdr/libchdr_lzma.c @@ -238,8 +238,8 @@ void lzma_codec_free(void* codec) lzma_allocator* alloc = &lzma_codec->allocator; /* free memory */ - lzma_allocator_free(alloc); LzmaDec_Free(&lzma_codec->decoder, (ISzAlloc*)&lzma_codec->allocator); + lzma_allocator_free(alloc); } /*-------------------------------------------------