From fa7a48172a3c9d9c2f96d6f9c05d80f497bc304d Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Tue, 22 Nov 2016 12:57:51 +0100 Subject: Added pointer tracing, and fixes memeory leaks within a single run of cmix. --- libcmix/cmix.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libcmix') diff --git a/libcmix/cmix.c b/libcmix/cmix.c index c60f441..00b080f 100644 --- a/libcmix/cmix.c +++ b/libcmix/cmix.c @@ -17,6 +17,7 @@ struct CMixContext initialize_cmix_context(struct Api api) { return (struct CMixContext){ .api = api, .nr_participants = 0, + .network_key = NULL, .r = NULL, .s = NULL, .permutation = NULL, @@ -59,6 +60,10 @@ void release_mix(struct CMixContext* ctx) { void deinitialize(struct CMixContext* ctx) { ctx->api.free_keypair(&ctx->keypair); + if(ctx->network_key != NULL) { + ctx->api.free_group_element(ctx->network_key); + ctx->network_key = NULL; + } release_mix(ctx); ctx->api.deinitialize(); } @@ -221,6 +226,8 @@ enum cmix_error permute_and_multiply_encrypted_s(struct CMixContext const* ctx, ctx->api.free_group_element(message_r); ctx->api.free_group_element(random_s); ctx->api.free_group_element(message_s); + ctx->api.free_group_element(random_pirs); + ctx->api.free_group_element(message_pirs); } return no_error; -- cgit v1.2.3-70-g09d2