Make Entry::m_tmpHistoryItem a QScopedPointer#2524
Make Entry::m_tmpHistoryItem a QScopedPointer#2524droidmonkey merged 3 commits intokeepassxreboot:developfrom
Conversation
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
|
I would personally prefer this be changed to a QScopedPointer. We have a couple of crashes that surround history items. The whole history process needs a good refactor. |
|
That sounds even better -- I'll look into that. |
|
Would you be open to using I realize that this goes against the conventions in this project (e.g. see #1213 (comment)). However, maybe it's time to revisit this? |
As suggested by @droidmonkey.
|
Regardless of my above suggestion, I've now updated this PR to make just |
|
In containers you use QSharedPointer |
src/core/Entry.cpp
Outdated
| , m_autoTypeAssociations(new AutoTypeAssociations(this)) | ||
| , m_customData(new CustomData(this)) | ||
| , m_tmpHistoryItem(nullptr) | ||
| , m_tmpHistoryItem() |
…9f734c..7943959d7 7943959d7 Merge pull request keepassxreboot#1 from sebastianlivoni/develop 42ba9be92 Merge branch 'feature/safari' into develop 003feb7c5 Merge pull request keepassxreboot#2571 from keepassxreboot/fix/check_input_width_with_segmented_totp 633fd4bf0 Merge pull request keepassxreboot#2574 from keepassxreboot/fix/atlassian_password_input 606e35762 Fix detecting Atlassian password input eb9285212 Fix checking input width with segmented TOTP fields dac9cecef Merge pull request keepassxreboot#2566 from keepassxreboot/fix/query_form_on_savedform_check 6b427faf3 Query form on savedForms check 54f5fe616 Merge pull request keepassxreboot#2560 from keepassxreboot/fix/update_issue_template cda5ee592 Merge pull request keepassxreboot#2553 from keepassxreboot/fix/styling_improvements 8c42d7fce Add some more space between options 2c639749c Styling improvements 951557d50 Merge pull request keepassxreboot#2548 from joetor5/html-id 4be2b176c Fix browser integration doc link id 86c17bf04 Merge pull request keepassxreboot#2542 from keepassxreboot/fix/chatgpt_submit_button 8e4b866f4 Add submit button exception for OpenAI login page a2748198b Merge pull request keepassxreboot#2525 from keepassxreboot/fix/credential_banner_improvement 064d27bf0 Improve username input detection with Credential Banner dccf307e0 Merge pull request keepassxreboot#2524 from keepassxreboot/feature/add_support_for_firefox_shortcuts_page c282d11ac Add support for opening Firefox shortcut settings page 5a6d37acf Merge pull request keepassxreboot#2523 from keepassxreboot/fix/get_credentials_from_different_db 7839dfe09 Fix retrieving credentials from changed DB in unlock dialog 25e1b2745 Merge pull request keepassxreboot#2522 from keepassxreboot/update_to_198 2bf48c680 Update to 1.9.8 0de621f0d Merge pull request keepassxreboot#2510 from keepassxreboot/fix/page_id_checks d5063a6cf Fixes for page object checks and context menu item creation a8297aeb5 Merge pull request keepassxreboot#2500 from keepassxreboot/fix/disable_passkeys_if_site_is_ignored a5e7444f3 Merge pull request keepassxreboot#2521 from keepassxreboot/feature/support_autocomplete_username f19c90cc0 Add support for autocomplete=username e11d63df5 Disable passkeys script injection if site is ignored git-subtree-dir: src/safariwebextension/keepassxc-browser git-subtree-split: 7943959d7bb61a900f900b0a633778ea2acefa83
Type of change
Description and Context
Most of the time,
m_tmpHistoryItemshould be null by the time anEntryis destroyed. However, if a caller ever callsbeginUpdate()without later callingendUpdate()-- 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
Testing strategy
make testcontinues to pass.Checklist:
-DWITH_ASAN=ON. [REQUIRED]