mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-02-03 01:50:10 -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& out = parser->isSet(Command::QuietOption) ? Utils::DEVNULL : Utils::STDOUT;
|
||||||
auto& err = Utils::STDERR;
|
auto& err = Utils::STDERR;
|
||||||
|
|
||||||
auto& entryPath = parser->positionalArguments().at(1);
|
auto entryPath = parser->positionalArguments().at(1);
|
||||||
QPointer<Entry> entry = database->rootGroup()->findEntryByPath(entryPath);
|
QPointer<Entry> entry = database->rootGroup()->findEntryByPath(entryPath);
|
||||||
if (!entry) {
|
if (!entry) {
|
||||||
err << QObject::tr("Entry %1 not found.").arg(entryPath) << endl;
|
err << QObject::tr("Entry %1 not found.").arg(entryPath) << endl;
|
||||||
@ -50,7 +50,7 @@ int Remove::executeWithDatabase(QSharedPointer<Database> database, QSharedPointe
|
|||||||
recycled = false;
|
recycled = false;
|
||||||
} else {
|
} else {
|
||||||
database->recycleEntry(entry);
|
database->recycleEntry(entry);
|
||||||
};
|
}
|
||||||
|
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!database->save(Database::Atomic, {}, &errorMessage)) {
|
if (!database->save(Database::Atomic, {}, &errorMessage)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user