From 32149f0e24f1c302ac6a2e6e8c9748334057b9a0 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Tue, 30 Jan 2024 02:37:48 -0800 Subject: [PATCH] VFS: Fix UB --- src/util/vfs/vfs-lzma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/vfs/vfs-lzma.c b/src/util/vfs/vfs-lzma.c index 0ded446bd..c9f88411d 100644 --- a/src/util/vfs/vfs-lzma.c +++ b/src/util/vfs/vfs-lzma.c @@ -94,12 +94,12 @@ static void _vd7zFree(ISzAllocPtr p, void* address) { struct VDir7zAlloc* alloc = (struct VDir7zAlloc*) p; size_t size = (size_t) TableLookup(&alloc->allocs, (uintptr_t) address >> 2); if (size) { + TableRemove(&alloc->allocs, (uintptr_t) address >> 2); if (size >= 0x10000) { mappedMemoryFree(address, size); } else { free(address); } - TableRemove(&alloc->allocs, (uintptr_t) address >> 2); } }