diff --git a/cpp/negentropy_wrapper.c b/cpp/negentropy_wrapper.c index f4ca627..3d3790b 100644 --- a/cpp/negentropy_wrapper.c +++ b/cpp/negentropy_wrapper.c @@ -64,7 +64,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){