Skip to content

Conversation

practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Aug 8, 2017

Fix potential memory leak when loading a corrupted wallet file.

@practicalswift practicalswift changed the title [qt] Fix memory leak when loading a corrupted wallet file [wallet] Fix memory leak when loading a corrupted wallet file Aug 8, 2017
@practicalswift practicalswift force-pushed the wallet-corrupted-leak branch from 3d02045 to 5e4e5c8 Compare August 8, 2017 15:39
@practicalswift practicalswift changed the title [wallet] Fix memory leak when loading a corrupted wallet file wallet: Fix memory leak when loading a corrupted wallet file Aug 8, 2017
@@ -3886,15 +3886,12 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile)
uiInterface.InitMessage(_("Zapping all transactions from wallet..."));

std::unique_ptr<CWalletDBWrapper> dbw(new CWalletDBWrapper(&bitdb, walletFile));
CWallet *tempWallet = new CWallet(std::move(dbw));
std::unique_ptr<CWallet> tempWallet(new CWallet(std::move(dbw)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: If you move the previous line into this one, you can omit the std::move operation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @eklitzke is right here that it would be good to avoid that std::move.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too long?

@fanquake fanquake added the Wallet label Aug 8, 2017
@gmaxwell
Copy link
Contributor

gmaxwell commented Aug 9, 2017

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.

Copy link
Contributor

@gmaxwell gmaxwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@practicalswift practicalswift changed the title wallet: Fix memory leak when loading a corrupted wallet file wallet: Fix potential memory leak when loading a corrupted wallet file Aug 9, 2017
@practicalswift
Copy link
Contributor Author

@gmaxwell That's a good point! I've now changed to "Fix potential memory leak" - works or still room for improvement? :-)

@practicalswift practicalswift force-pushed the wallet-corrupted-leak branch from 5e4e5c8 to c8b4b80 Compare August 9, 2017 08:40
@maflcko
Copy link
Member

maflcko commented Aug 10, 2017

utACK c8b4b80df8346739c9a52113fd6673db1574e1f3

@practicalswift
Copy link
Contributor Author

Rebased!

@laanwj laanwj merged commit c06755f into bitcoin:master Aug 22, 2017
laanwj added a commit that referenced this pull request Aug 22, 2017
…ted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 19, 2019
… corrupted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 23, 2019
… corrupted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 24, 2019
… corrupted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Nov 19, 2019
… corrupted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Nov 21, 2019
… corrupted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Dec 9, 2019
… corrupted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 1, 2020
… corrupted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 2, 2020
… corrupted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jan 2, 2020
… corrupted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
@practicalswift practicalswift deleted the wallet-corrupted-leak branch April 10, 2021 19:32
gades pushed a commit to cosanta/cosanta-core that referenced this pull request Jun 25, 2021
… corrupted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
gades pushed a commit to cosanta/cosanta-core that referenced this pull request Feb 5, 2022
… corrupted wallet file

c06755f wallet: Fix memory leak when loading a corrupted wallet file (practicalswift)

Pull request description:

  Fix potential memory leak when loading a corrupted wallet file.

Tree-SHA512: 4b836e4ee1fe4267213bb126af0c1174f964ff015fbe28d0a7e679eab877c275769906b3c08f885763958f6a9b559e1b5e6c7bff1df340bf2dfa2acd57500818
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants