mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 13:50:13 +00:00
TRECISION: Fix memory leaks. PVS-Studio V773
This commit is contained in:
parent
fa82075d8d
commit
5140438d60
@ -87,12 +87,12 @@ bool Console::Cmd_DumpAnim(int argc, const char **argv) {
|
||||
|
||||
Common::SeekableReadStream *dataFile = animFile.createReadStreamForMember(fileName);
|
||||
|
||||
Common::DumpFile *outFile = new Common::DumpFile();
|
||||
Common::DumpFile outFile;
|
||||
Common::String outName = fileName + ".dump";
|
||||
outFile->open(outName);
|
||||
outFile->writeStream(dataFile, dataFile->size());
|
||||
outFile->finalize();
|
||||
outFile->close();
|
||||
outFile.open(outName);
|
||||
outFile.writeStream(dataFile, dataFile->size());
|
||||
outFile.finalize();
|
||||
outFile.close();
|
||||
|
||||
animFile.close();
|
||||
|
||||
@ -114,12 +114,12 @@ bool Console::Cmd_DumpFile(int argc, const char **argv) {
|
||||
|
||||
Common::SeekableReadStream *dataFile = fileName.hasSuffix(".cr") ? _vm->_dataFile.createReadStreamForCompressedMember(fileName) : _vm->_dataFile.createReadStreamForMember(fileName);
|
||||
|
||||
Common::DumpFile *outFile = new Common::DumpFile();
|
||||
Common::DumpFile outFile;
|
||||
Common::String outName = fileName + ".dump";
|
||||
outFile->open(outName);
|
||||
outFile->writeStream(dataFile, dataFile->size());
|
||||
outFile->finalize();
|
||||
outFile->close();
|
||||
outFile.open(outName);
|
||||
outFile.writeStream(dataFile, dataFile->size());
|
||||
outFile.finalize();
|
||||
outFile.close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -129,8 +129,10 @@ NightlongAmigaDecoder::AmigaVideoTrack::AmigaVideoTrack(const Common::String &fi
|
||||
Common::File *stream = new Common::File();
|
||||
stream->open(fileName);
|
||||
|
||||
if (!stream->isOpen())
|
||||
if (!stream->isOpen()) {
|
||||
delete stream;
|
||||
return;
|
||||
}
|
||||
|
||||
_curFrame = 0;
|
||||
_frameCount = 10; // TODO: Anything > 1 to keep playing till the audio is done
|
||||
|
Loading…
Reference in New Issue
Block a user