[Scummvm-git-logs] scummvm master -> 1373e9b6a0c7ce3ee4c15eedef173a4a049d5f6c

sev- sev at scummvm.org
Mon Dec 12 23:50:44 CET 2016


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:
1373e9b6a0 FULLPIPE: Avoid double free on memory cleanup


Commit: 1373e9b6a0c7ce3ee4c15eedef173a4a049d5f6c
    https://github.com/scummvm/scummvm/commit/1373e9b6a0c7ce3ee4c15eedef173a4a049d5f6c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-12-12T23:50:24+01:00

Commit Message:
FULLPIPE: Avoid double free on memory cleanup

Changed paths:
    engines/fullpipe/gameloader.cpp


diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index 2d7dc31..28e5f37 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -85,23 +85,6 @@ GameLoader::~GameLoader() {
 
 	g_fp->_gameLoader = 0;
 
-	for (uint i = 0; i < _sc2array.size(); i++) {
-		if (_sc2array[i]._defPicAniInfos)
-			free(_sc2array[i]._defPicAniInfos);
-
-		if (_sc2array[i]._picAniInfos)
-			free(_sc2array[i]._picAniInfos);
-
-		if (_sc2array[i]._motionController)
-			delete _sc2array[i]._motionController;
-
-		if (_sc2array[i]._data1)
-			free(_sc2array[i]._data1);
-
-		if (_sc2array[i]._entranceData)
-			free(_sc2array[i]._entranceData);
-	}
-
 	delete _gameVar;
 	_gameVar = 0;
 
@@ -628,6 +611,10 @@ Sc2::~Sc2() {
 	for (int i = 0; i < _entranceDataCount; i++)
 		delete _entranceData[i];
 	free(_entranceData);
+
+	for (uint i = 0; i < _picAniInfosCount; i++)
+		delete _picAniInfos[i];
+	free(_picAniInfos);
 }
 
 bool Sc2::load(MfcArchive &file) {





More information about the Scummvm-git-logs mailing list