Fix potential memory leak in newPossibleKey(ChangeCWallet *wallet).
[qt] Fix potential memory leak in newPossibleKey(ChangeCWallet *wallet) #10920
pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:fix-newPossibleKeyChange-memory-leak changing 2 files +3 −5-
practicalswift commented at 8:34 PM on July 24, 2017: contributor
-
sipa commented at 10:31 PM on July 24, 2017: member
Is it possible to change this to use a
unique_ptrinstead? -
promag commented at 11:24 PM on July 24, 2017: member
:+1: @sipa suggestion.
Correct me if I'm wrong, but from what I've seen,
WalletModelTransaction::keyChangepointer is initialized to null, and only has a value whennewPossibleKeyChangeis called. So, in the first call, this woulddelete NULL.Moreover, in the
~WalletModelTransactionit alsodelete keyChangewhich can be null ifnewPossibleKeyChangeis not called. -
practicalswift commented at 8:00 AM on July 25, 2017: contributor
-
promag commented at 8:42 AM on July 25, 2017: member
Yeah it's safe, can be avoided though.
-
luke-jr commented at 6:41 AM on July 26, 2017: member
But there's no reason to avoid it..
- practicalswift force-pushed on Aug 7, 2017
- practicalswift force-pushed on Aug 7, 2017
-
practicalswift commented at 2:29 PM on August 7, 2017: contributor
Now using
unique_ptr. Please review :-) -
[qt] Fix potential memory leak in newPossibleKey(ChangeCWallet *wallet) 446e2610b0
- practicalswift force-pushed on Aug 7, 2017
-
jonasschnelli commented at 3:04 PM on August 7, 2017: contributor
utACK 1ce39c59c22a5878b5af6a4ff821db83c988e8b7
-
ryanofsky commented at 3:05 PM on August 7, 2017: member
utACK 446e2610b0cd6535e623952bf22ea09ce0ed8aaf. FWIW #10244 (commit "Remove most direct bitcoin calls from qt/walletmodel.cpp") takes this cleanup further, combining key and transaction into a pending transaction object and referencing that through a unique pointer.
- MarcoFalke added the label GUI on Sep 25, 2017
-
promag commented at 5:19 PM on October 8, 2017: member
utACK 446e261.
-
laanwj commented at 12:07 PM on November 17, 2017: member
utACK 446e261
- laanwj merged this on Nov 17, 2017
- laanwj closed this on Nov 17, 2017
- laanwj referenced this in commit f6f8d54aff on Nov 17, 2017
- PastaPastaPasta referenced this in commit 8170ad7a65 on Jan 17, 2020
- PastaPastaPasta referenced this in commit c6dc88b440 on Jan 22, 2020
- PastaPastaPasta referenced this in commit 9957b034d5 on Jan 22, 2020
- PastaPastaPasta referenced this in commit 2ccefac040 on Jan 29, 2020
- PastaPastaPasta referenced this in commit 581c49d88d on Jan 29, 2020
- PastaPastaPasta referenced this in commit 11d59e785d on Jan 29, 2020
- ckti referenced this in commit dafa9b9177 on Mar 28, 2021
- practicalswift deleted the branch on Apr 10, 2021
- gades referenced this in commit 8496eedef9 on Mar 8, 2022
- DrahtBot locked this on Aug 18, 2022