androiddeplyqt: fix more missing pclose() on early returns

Found by Coverity.

This code predates the move of androiddeployqt to qtbase.

Pick-to: 6.7 6.6 6.5 6.2 5.15
Coverity-Id: 378442
Change-Id: Icc24918159132c55a3817eaf19c96ea212dfa6dc
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
Marc Mutz 2024-03-28 10:11:07 +01:00
parent c64b30129d
commit db240d99cf

View File

@ -2202,6 +2202,7 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
QJsonDocument jsonDocument = QJsonDocument::fromJson(output);
if (jsonDocument.isNull()) {
fprintf(stderr, "Invalid json output from qmlimportscanner.\n");
pclose(qmlImportScannerCommand);
return false;
}
@ -2210,6 +2211,7 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
QJsonValue value = jsonArray.at(i);
if (!value.isObject()) {
fprintf(stderr, "Invalid format of qmlimportscanner output.\n");
pclose(qmlImportScannerCommand);
return false;
}
@ -2255,6 +2257,7 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
if (importPathOfThisImport.isEmpty()) {
fprintf(stderr, "Import found outside of import paths: %s.\n", qPrintable(info.absoluteFilePath()));
pclose(qmlImportScannerCommand);
return false;
}
@ -2322,6 +2325,7 @@ bool scanImports(Options *options, QSet<QString> *usedDependencies)
}
}
pclose(qmlImportScannerCommand);
return true;
}