diff --git a/src/platform/qt/utils.cpp b/src/platform/qt/utils.cpp index 99859dbc4..c445c41b8 100644 --- a/src/platform/qt/utils.cpp +++ b/src/platform/qt/utils.cpp @@ -138,7 +138,14 @@ bool extractMatchingFile(VDir* dir, std::function filter) continue; } VFile* outfile = VFileOpen(target.toUtf8().constData(), O_WRONLY | O_TRUNC | O_CREAT); + if (!outfile) { + return false; + } VFile* infile = dir->openFile(dir, entry->name(entry), O_RDONLY); + if (!infile) { + outfile->close(outfile); + return false; + } VFileDevice::copyFile(infile, outfile); infile->close(infile); outfile->close(outfile);