Make Entry::m_tmpHistoryItem a QScopedPointer (#2524)
* Make m_tmpHistoryItem a QScopedPointer Most of the time, `m_tmpHistoryItem` should be null by the time an `Entry` is destroyed. However, if a caller ever calls `beginUpdate()` without later calling `endUpdate()` -- perhaps because an exception was throw in the meantime -- it may not be null. This change avoids a memory leak in that case. Found via https://lgtm.com/projects/g/keepassxreboot/keepassxc/alerts
This commit is contained in:
committed by
Jonathan White
parent
1af293847c
commit
bdee748a6a
@@ -249,7 +249,7 @@ private:
|
||||
QPointer<CustomData> m_customData;
|
||||
QList<Entry*> m_history; // Items sorted from oldest to newest
|
||||
|
||||
Entry* m_tmpHistoryItem;
|
||||
QScopedPointer<Entry> m_tmpHistoryItem;
|
||||
bool m_modifiedSinceBegin;
|
||||
QPointer<Group> m_group;
|
||||
bool m_updateTimeinfo;
|
||||
|
||||
Reference in New Issue
Block a user