0
0
mirror of https://github.com/keepassxreboot/keepassxc.git synced 2024-09-19 20:02:18 +02:00

Fix dangling reference (#10135)

This commit is contained in:
Dmytro 2024-01-06 10:58:56 -08:00 committed by GitHub
parent d44486ce94
commit 5d64292ed8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,7 @@ int Remove::executeWithDatabase(QSharedPointer<Database> database, QSharedPointe
auto& out = parser->isSet(Command::QuietOption) ? Utils::DEVNULL : Utils::STDOUT;
auto& err = Utils::STDERR;
auto& entryPath = parser->positionalArguments().at(1);
auto entryPath = parser->positionalArguments().at(1);
QPointer<Entry> entry = database->rootGroup()->findEntryByPath(entryPath);
if (!entry) {
err << QObject::tr("Entry %1 not found.").arg(entryPath) << endl;
@ -50,7 +50,7 @@ int Remove::executeWithDatabase(QSharedPointer<Database> database, QSharedPointe
recycled = false;
} else {
database->recycleEntry(entry);
};
}
QString errorMessage;
if (!database->save(Database::Atomic, {}, &errorMessage)) {