diff options
| author | Gregory Maxwell <[email protected]> | 2012-06-22 08:38:48 -0700 |
|---|---|---|
| committer | Gregory Maxwell <[email protected]> | 2012-06-22 08:38:48 -0700 |
| commit | a3869547e5ea4ff92ff534c2f24571165dc2dd02 (patch) | |
| tree | ebdcbc4a2413f2b524a0f174cb670c2fc83b3c1f /src/key.cpp | |
| parent | Merge pull request #1490 from luke-jr/gd_ljr_key (diff) | |
| parent | fix a memory leak in key.cpp (diff) | |
| download | discoin-a3869547e5ea4ff92ff534c2f24571165dc2dd02.tar.xz discoin-a3869547e5ea4ff92ff534c2f24571165dc2dd02.zip | |
Merge pull request #1495 from Diapolo/fix_CKey_mem_leak
fix a memory leak in key.cpp
Diffstat (limited to 'src/key.cpp')
| -rw-r--r-- | src/key.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/key.cpp b/src/key.cpp index 57ab842bc..c943a38ea 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -129,6 +129,8 @@ void CKey::SetCompressedPubKey() void CKey::Reset() { fCompressedPubKey = false; + if (pkey != NULL) + EC_KEY_free(pkey); pkey = EC_KEY_new_by_curve_name(NID_secp256k1); if (pkey == NULL) throw key_error("CKey::CKey() : EC_KEY_new_by_curve_name failed"); @@ -137,6 +139,7 @@ void CKey::Reset() CKey::CKey() { + pkey = NULL; Reset(); } |