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){