[Scummvm-cvs-logs] scummvm master -> 18193d170e37e0744ad0a9dfe6beed0e2238f9bd

lordhoto lordhoto at gmail.com
Sun May 15 15:50:16 CEST 2016


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

Summary:
109c54c95b Revert "KYRA: Plug memory leak"
3664caa29c KYRA: Silence analysis tools about possible memory leaks
18193d170e Revert "KYRA: Plug memory leak"


Commit: 109c54c95bdd0888c9ada563e7a7edc35634716b
    https://github.com/scummvm/scummvm/commit/109c54c95bdd0888c9ada563e7a7edc35634716b
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2016-05-15T15:39:05+02:00

Commit Message:
Revert "KYRA: Plug memory leak"

This reverts commit c22ca8ffb515b03712a0f0e36dd40c7e38c4b8ed.

This revision caused invalid memory reads in Kyra1 DOS+FM-TOWNS.

Changed paths:
    engines/kyra/staticres.cpp



diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 8ad02c7..1a2e2c0 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -839,8 +839,6 @@ void KyraEngine_LoK::initStaticResource() {
 		_sound->initAudioResourceInfo(kMusicIntro, &resInfoIntro);
 		_sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame);
 	}
-
-	delete[] soundFiles;
 }
 
 void KyraEngine_LoK::loadMouseShapes() {


Commit: 3664caa29cd3b6c4bf3e9d8663ba8839f3455684
    https://github.com/scummvm/scummvm/commit/3664caa29cd3b6c4bf3e9d8663ba8839f3455684
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2016-05-15T15:45:05+02:00

Commit Message:
KYRA: Silence analysis tools about possible memory leaks

Changed paths:
    engines/kyra/staticres.cpp



diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 1a2e2c0..da8eec1 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -838,6 +838,14 @@ void KyraEngine_LoK::initStaticResource() {
 		SoundResourceInfo_PC98 resInfoIngame("KYRAM%d.DAT");
 		_sound->initAudioResourceInfo(kMusicIntro, &resInfoIntro);
 		_sound->initAudioResourceInfo(kMusicIngame, &resInfoIngame);
+
+		// This should never happen, but we add this to silence static
+		// analysis tools which complain about memory leaks.
+		delete[] soundFiles;
+	} else {
+		// This should never happen, but we add this to silence static
+		// analysis tools which complain about memory leaks.
+		delete[] soundFiles;
 	}
 }
 


Commit: 18193d170e37e0744ad0a9dfe6beed0e2238f9bd
    https://github.com/scummvm/scummvm/commit/18193d170e37e0744ad0a9dfe6beed0e2238f9bd
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2016-05-15T15:48:17+02:00

Commit Message:
Revert "KYRA: Plug memory leak"

This reverts commit 9909cc615d527bc8d43f930d8c88dc014974f2de.

This will likely cause invalid memory reads because it frees the last output
buffer which is used to keep files in memory. There is a possible memory leak
here, when the input data is not well formed. However, fixing this takes some
more effort than the solution in the reverted commit.

Changed paths:
    engines/kyra/resource_intern.cpp



diff --git a/engines/kyra/resource_intern.cpp b/engines/kyra/resource_intern.cpp
index 75e98d3..9ec9554 100644
--- a/engines/kyra/resource_intern.cpp
+++ b/engines/kyra/resource_intern.cpp
@@ -1180,8 +1180,6 @@ Common::Archive *InstallerLoader::load(Resource *owner, const Common::String &fi
 			delete tmpFile;
 			tmpFile = 0;
 		}
-		delete[] outbuffer;
-		outbuffer = 0;
 	}
 
 	archives.clear();






More information about the Scummvm-git-logs mailing list