[Scummvm-git-logs] scummvm master -> 5656c999f8503ef5f52dfad5dbef1be81663a9e9

sluicebox noreply at scummvm.org
Tue Dec 19 12:11:56 UTC 2023


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5656c999f8 KINGDOM: Fix memory leak. PVS-Studio V773


Commit: 5656c999f8503ef5f52dfad5dbef1be81663a9e9
    https://github.com/scummvm/scummvm/commit/5656c999f8503ef5f52dfad5dbef1be81663a9e9
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-19T04:11:02-08:00

Commit Message:
KINGDOM: Fix memory leak. PVS-Studio V773

Changed paths:
    engines/kingdom/kingdom.cpp


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;




More information about the Scummvm-git-logs mailing list