Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keepassxreboot/keepassxc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/keepassxc-cli.cpp')
-rw-r--r--src/cli/keepassxc-cli.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cli/keepassxc-cli.cpp b/src/cli/keepassxc-cli.cpp
index a9b276fda..2f8294446 100644
--- a/src/cli/keepassxc-cli.cpp
+++ b/src/cli/keepassxc-cli.cpp
@@ -158,7 +158,7 @@ void enterInteractiveMode(const QStringList& arguments)
auto cmd = Commands::getCommand(args[0]);
if (!cmd) {
- err << QObject::tr("Unknown command %1").arg(args[0]) << "\n";
+ err << QObject::tr("Unknown command %1").arg(args[0]) << endl;
continue;
} else if (cmd->name == "quit" || cmd->name == "exit") {
break;
@@ -167,6 +167,7 @@ void enterInteractiveMode(const QStringList& arguments)
cmd->currentDatabase = currentDatabase;
cmd->execute(args);
currentDatabase = cmd->currentDatabase;
+ cmd->currentDatabase.reset();
}
if (currentDatabase) {
@@ -246,6 +247,10 @@ int main(int argc, char** argv)
arguments.removeFirst();
int exitCode = command->execute(arguments);
+ if (command->currentDatabase) {
+ command->currentDatabase.reset();
+ }
+
#if defined(WITH_ASAN) && defined(WITH_LSAN)
// do leak check here to prevent massive tail of end-of-process leak errors from third-party libraries
__lsan_do_leak_check();