diff options
| author | Max Horn | 2011-05-17 15:04:07 +0200 | 
|---|---|---|
| committer | Max Horn | 2011-05-17 15:04:07 +0200 | 
| commit | 2149edbe5d5c4699eaaf826c7a769ab764548eac (patch) | |
| tree | dab52e0222d0fa2271f4190c3766273cc9b64172 | |
| parent | 9b2ef340dceebc3db36519051e45af0fd9477850 (diff) | |
| download | scummvm-rg350-2149edbe5d5c4699eaaf826c7a769ab764548eac.tar.gz scummvm-rg350-2149edbe5d5c4699eaaf826c7a769ab764548eac.tar.bz2 scummvm-rg350-2149edbe5d5c4699eaaf826c7a769ab764548eac.zip | |
M4: Fix leak in Console::cmdDumpFile
| -rw-r--r-- | engines/m4/console.cpp | 6 | ||||
| -rw-r--r-- | engines/m4/m4.cpp | 2 | ||||
| -rw-r--r-- | engines/m4/m4.h | 2 | 
3 files changed, 5 insertions, 5 deletions
| diff --git a/engines/m4/console.cpp b/engines/m4/console.cpp index b6d8093f78..6f45f11f5a 100644 --- a/engines/m4/console.cpp +++ b/engines/m4/console.cpp @@ -147,12 +147,12 @@ bool Console::cmdDumpFile(int argc, const char **argv) {  		DebugPrintf("If uncompress is 1, the file is uncompressed (for MADS games)\n");  	} else {  		if (argc == 2) { -			_vm->dumpFile(strdup(argv[1])); +			_vm->dumpFile(argv[1], false);  		} else {  			if (argc == 3 && atoi(argv[2]) == 1) -				_vm->dumpFile(strdup(argv[1]), true); +				_vm->dumpFile(argv[1], true);  			else -				_vm->dumpFile(strdup(argv[1])); +				_vm->dumpFile(argv[1], false);  		}  	}  	return true; diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp index 881a523935..d456accca1 100644 --- a/engines/m4/m4.cpp +++ b/engines/m4/m4.cpp @@ -255,7 +255,7 @@ void MadsM4Engine::loadMenu(MenuType menuType, bool loadSaveFromHotkey, bool cal  #define DUMP_BUFFER_SIZE 1024 -void MadsM4Engine::dumpFile(const char* filename, bool uncompress) { +void MadsM4Engine::dumpFile(const char *filename, bool uncompress) {  	Common::DumpFile f;  	byte buffer[DUMP_BUFFER_SIZE];  	Common::SeekableReadStream *fileS = res()->get(filename); diff --git a/engines/m4/m4.h b/engines/m4/m4.h index 4c693d799c..4c9b100117 100644 --- a/engines/m4/m4.h +++ b/engines/m4/m4.h @@ -165,7 +165,7 @@ public:  	ResourceManager *res() const { return _resourceManager; }  	MidiPlayer *midi() { return _midi; }  	Common::SaveFileManager *saveManager() { return _saveFileMan; } -	void dumpFile(const char* filename, bool uncompress = false); +	void dumpFile(const char *filename, bool uncompress);  	void eventHandler();  	bool delay(int duration, bool keyAborts = true, bool clickAborts = true);  	void loadMenu(MenuType menuType, bool loadSaveFromHotkey = false, | 
