wallet: Fix potential memory leak when loading a corrupted wallet file #11007

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:wallet-corrupted-leak changing 1 files +1 −4
  1. practicalswift commented at 3:39 pm on August 8, 2017: contributor
    Fix potential memory leak when loading a corrupted wallet file.
  2. practicalswift renamed this:
    [qt] Fix memory leak when loading a corrupted wallet file
    [wallet] Fix memory leak when loading a corrupted wallet file
    on Aug 8, 2017
  3. practicalswift force-pushed on Aug 8, 2017
  4. practicalswift renamed this:
    [wallet] Fix memory leak when loading a corrupted wallet file
    wallet: Fix memory leak when loading a corrupted wallet file
    on Aug 8, 2017
  5. in src/wallet/wallet.cpp:3940 in 5e4e5c89e3 outdated
    3885@@ -3886,15 +3886,12 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile)
    3886         uiInterface.InitMessage(_("Zapping all transactions from wallet..."));
    3887 
    3888         std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, walletFile));
    3889-        CWallet *tempWallet = new CWallet(std::move(dbw));
    3890+        std::unique_ptr<CWallet> tempWallet(new CWallet(std::move(dbw)));
    


    eklitzke commented at 9:35 pm on August 8, 2017:
    nit: If you move the previous line into this one, you can omit the std::move operation.

    jonasschnelli commented at 7:26 pm on August 15, 2017:
    I think @eklitzke is right here that it would be good to avoid that std::move.

    promag commented at 7:31 am on August 22, 2017:
    Too long?
  6. fanquake added the label Wallet on Aug 8, 2017
  7. gmaxwell commented at 0:21 am on August 9, 2017: contributor
    Please avoid titling PR’s with things like “Fix memory leak” for things where there isn’t an actual leak in practice. (e.g. because it exits). Changes like this are good but they mess up people trying to figure out if an issue they are encounter has been fixed (“I have a memory leak, oh they just fixed one. They’s probably it.”), or when slowing things down when looking for other issues.
  8. gmaxwell approved
  9. gmaxwell commented at 0:23 am on August 9, 2017: contributor
    utACK
  10. practicalswift renamed this:
    wallet: Fix memory leak when loading a corrupted wallet file
    wallet: Fix potential memory leak when loading a corrupted wallet file
    on Aug 9, 2017
  11. practicalswift commented at 4:54 am on August 9, 2017: contributor
    @gmaxwell That’s a good point! I’ve now changed to “Fix potential memory leak” - works or still room for improvement? :-)
  12. practicalswift force-pushed on Aug 9, 2017
  13. MarcoFalke commented at 8:57 am on August 10, 2017: member
    utACK c8b4b80df8346739c9a52113fd6673db1574e1f3
  14. wallet: Fix memory leak when loading a corrupted wallet file c06755f5cf
  15. practicalswift force-pushed on Aug 14, 2017
  16. practicalswift commented at 3:55 pm on August 14, 2017: contributor
    Rebased!
  17. laanwj merged this on Aug 22, 2017
  18. laanwj closed this on Aug 22, 2017

  19. laanwj referenced this in commit fc5c237d4a on Aug 22, 2017
  20. PastaPastaPasta referenced this in commit 26d9c48749 on Sep 19, 2019
  21. PastaPastaPasta referenced this in commit 72dcf30b5b on Sep 23, 2019
  22. PastaPastaPasta referenced this in commit 6c1424b6fc on Sep 24, 2019
  23. PastaPastaPasta referenced this in commit b9b6890dba on Nov 19, 2019
  24. PastaPastaPasta referenced this in commit f7f00a3ef8 on Nov 21, 2019
  25. PastaPastaPasta referenced this in commit 8d3a0fac21 on Dec 9, 2019
  26. PastaPastaPasta referenced this in commit dba9ffefe5 on Jan 1, 2020
  27. PastaPastaPasta referenced this in commit 483b545fc4 on Jan 2, 2020
  28. PastaPastaPasta referenced this in commit 1273fc2795 on Jan 2, 2020
  29. ckti referenced this in commit b05237617d on Mar 28, 2021
  30. practicalswift deleted the branch on Apr 10, 2021
  31. gades referenced this in commit adaf233247 on Jun 25, 2021
  32. gades referenced this in commit 44add6b430 on Feb 5, 2022
  33. DrahtBot locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-05 01:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me