From 48324348657a78865c0a6395a1149f1bb4dec2e8 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 15 Jul 2019 20:57:43 -0700 Subject: [PATCH] UI: Fix zip leak in error case. --- Core/Util/GameManager.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/Util/GameManager.cpp b/Core/Util/GameManager.cpp index 94d3bb34ee..10586b3086 100644 --- a/Core/Util/GameManager.cpp +++ b/Core/Util/GameManager.cpp @@ -289,11 +289,16 @@ bool GameManager::InstallGame(const std::string &url, const std::string &fileNam File::CreateFullPath(dest); File::CreateEmptyFile(dest + "/.nomedia"); return InstallMemstickGame(z, fileName, dest, info, true, deleteAfter); + } else { + zip_close(z); + z = nullptr; } return false; default: ERROR_LOG(HLE, "File not a PSP game, no EBOOT.PBP found."); SetInstallError(sy->T("Not a PSP game")); + zip_close(z); + z = nullptr; if (deleteAfter) File::Delete(fileName); return false;