M4: Fix leak in Console::cmdDumpFile

This commit is contained in:
Max Horn 2011-05-17 15:04:07 +02:00
parent 9b2ef340dc
commit 2149edbe5d
3 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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,