mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-02 06:41:51 +00:00
M4: Fix leak in Console::cmdDumpFile
This commit is contained in:
parent
9b2ef340dc
commit
2149edbe5d
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user