diff --git a/src/cli/main.cpp b/src/cli/main.cpp index df85f0f7b..2d2eeef59 100644 --- a/src/cli/main.cpp +++ b/src/cli/main.cpp @@ -336,8 +336,7 @@ int main(int argc, char *argv[]) for (const QString &error: cliErrors) { showCliError(error); } - if (!cliErrors.isEmpty()) { - return EXIT_FAILURE; - } - return (command->start()) ? QCoreApplication::exec() : EXIT_FAILURE; + const int result = ((cliErrors.isEmpty()) && (command->start())) ? QCoreApplication::exec() : EXIT_FAILURE; + delete command; + return result; }