From fa1473792677f5cb66215b2b7017e8ae7996a452 Mon Sep 17 00:00:00 2001 From: Prem Chaitanya Prathi Date: Thu, 7 Mar 2024 09:02:06 +0530 Subject: [PATCH] fix: leak in initiate --- cpp/negentropy_wrapper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp/negentropy_wrapper.c b/cpp/negentropy_wrapper.c index 5a14c37..363282d 100644 --- a/cpp/negentropy_wrapper.c +++ b/cpp/negentropy_wrapper.c @@ -63,7 +63,9 @@ size_t negentropy_initiate(void* negentropy, buffer* out){ return 0; } memcpy( out->data, output->c_str() ,output->size()); - return output->size(); + size_t outlen = output->size(); + delete output; + return outlen; } void negentropy_setinitiator(void* negentropy){