git://git.novaco.in
/
novacoin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
d8e8516
)
BUGFIX: SignCompact/SignCompactSignature memory leak
author
alex
<alex@alex-VirtualBox.(none)>
Sun, 28 Jul 2013 23:25:22 +0000 (
03:25
+0400)
committer
alex
<alex@alex-VirtualBox.(none)>
Sun, 28 Jul 2013 23:25:22 +0000 (
03:25
+0400)
src/key.cpp
patch
|
blob
|
history
diff --git
a/src/key.cpp
b/src/key.cpp
index
23f3152
..
d9c2832
100644
(file)
--- a/
src/key.cpp
+++ b/
src/key.cpp
@@
-328,7
+328,10
@@
bool CKey::SignCompact(uint256 hash, std::vector<unsigned char>& vchSig)
}
if (nRecId == -1)
+ {
+ ECDSA_SIG_free(sig);
throw key_error("CKey::SignCompact() : unable to construct recoverable key");
+ }
vchSig[0] = nRecId+27+(fCompressedPubKey ? 4 : 0);
BN_bn2bin(sig->r,&vchSig[33-(nBitsR+7)/8]);
@@
-367,6
+370,7
@@
bool CKey::SetCompactSignature(uint256 hash, const std::vector<unsigned char>& v
ECDSA_SIG_free(sig);
return true;
}
+ ECDSA_SIG_free(sig);
return false;
}