aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/security/signer.cc
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2020-03-11 13:42:39 +0000
committerGerrit Code Review <gerrit@fd.io>2020-03-11 13:42:39 +0000
commit0e9fe18eac5ca679dcec2346e42e7fb638acbeee (patch)
tree1f1c65188d2690a15bdb51d1dbe1f6ede676dc57 /libtransport/src/security/signer.cc
parent642ac16179e8a041f37d749f5bf72512f76fcfae (diff)
parentc564dd5c456de2d27b43cb3888d998e814abba57 (diff)
Merge "[HICN-546] Fix memory leak on producer side"
Diffstat (limited to 'libtransport/src/security/signer.cc')
-rw-r--r--libtransport/src/security/signer.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/libtransport/src/security/signer.cc b/libtransport/src/security/signer.cc
index 314c3ea82..8a56cfa3d 100644
--- a/libtransport/src/security/signer.cc
+++ b/libtransport/src/security/signer.cc
@@ -162,12 +162,10 @@ void Signer::sign(Packet &packet) {
}
CryptoHash hash = hasher.finalize();
-
signature_ = parcSigner_SignDigestNoAlloc(this->signer_, hash.hash_,
packet.getSignature(),
(uint32_t)signature_length_);
PARCBuffer *buffer = parcSignature_GetSignature(signature_);
-
size_t bytes_len = parcBuffer_Remaining(buffer);
if (bytes_len > signature_length_) {
@@ -176,6 +174,8 @@ void Signer::sign(Packet &packet) {
hicn_packet_copy_header(format, &header_copy,
(hicn_header_t *)packet.packet_start_, false);
+
+ parcSignature_Release(&signature_);
}
size_t Signer::getSignatureLength() { return signature_length_; }