UI: Fix zip leak in error case.

This commit is contained in:
Unknown W. Brackets 2019-07-15 20:57:43 -07:00
parent a49a0fc076
commit 4832434865

View file

@ -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;