TESTBED: Fix memory leak on error. PVS-Studio V773

This commit is contained in:
sluicebox 2023-10-30 11:22:12 -07:00
parent fc32df7533
commit fa82075d8d

View File

@ -36,6 +36,7 @@ Common::Error Videotests::videoTest(const Common::Path &path) {
Common::File *file = new Common::File();
if (!file->open(path)) {
warning("Cannot open file %s", path.toString().c_str());
delete file;
return Common::kNoGameDataFoundError;
}
return videoTest(file, path.toString());