From 69c9133cd4e5daba61ed18c859047dc777b18ae7 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 5 Apr 2024 14:48:16 +1000 Subject: [PATCH] Common: Fix double free on opening invalid zip file --- src/common/minizip_helpers.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/common/minizip_helpers.h b/src/common/minizip_helpers.h index b9cca033d..926e598c4 100644 --- a/src/common/minizip_helpers.h +++ b/src/common/minizip_helpers.h @@ -65,11 +65,7 @@ namespace MinizipHelpers { #undef FI - unzFile zf = unzOpen2_64("", &funcs); - if (!zf) - delete fi; - - return zf; + return unzOpen2_64("", &funcs); } [[maybe_unused]] static unzFile OpenUnzFile(const char* filename)