summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-03-28 10:11:07 +0100
committerMarc Mutz <marc.mutz@qt.io>2024-04-18 10:31:01 +0100
commitdb240d99cffbc3af2eb39a5f7d48e68e57b85271 (patch)
tree81357ff176cc231e4fed13e9a37154d54ce770e5
parentc64b30129d7c6c7f99b6abc3f42d32fb61e27f76 (diff)
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>
-rw-r--r--src/tools/androiddeployqt/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index 273e818189..6125b405b5 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -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;
}