mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-02 17:44:46 -05:00
Fix dangling reference (#10135)
This commit is contained in:
parent
d44486ce94
commit
5d64292ed8
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user