From 5656c999f8503ef5f52dfad5dbef1be81663a9e9 Mon Sep 17 00:00:00 2001 From: sluicebox <22204938+sluicebox@users.noreply.github.com> Date: Tue, 19 Dec 2023 04:11:02 -0800 Subject: [PATCH] KINGDOM: Fix memory leak. PVS-Studio V773 --- engines/kingdom/kingdom.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/engines/kingdom/kingdom.cpp b/engines/kingdom/kingdom.cpp index 0316878723f..cae674cb127 100644 --- a/engines/kingdom/kingdom.cpp +++ b/engines/kingdom/kingdom.cpp @@ -389,6 +389,7 @@ Common::SeekableReadStream *KingdomGame::loadAResource(int reznum) { Common::File *file = new Common::File(); if(!file->open(path)) { warning("Failed to open %s", path.c_str()); + delete file; return nullptr; } else { return file;