diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-11-22 12:57:51 +0100 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-11-22 12:57:51 +0100 |
| commit | fa7a48172a3c9d9c2f96d6f9c05d80f497bc304d (patch) | |
| tree | 2c56890a3c0f12ca68ec16e120474ab6b0366bf9 /libcmix | |
| parent | 4471b16ee9961f55086841204f91f5c172d917f6 (diff) | |
| download | cmix-fa7a48172a3c9d9c2f96d6f9c05d80f497bc304d.tar.gz cmix-fa7a48172a3c9d9c2f96d6f9c05d80f497bc304d.tar.bz2 cmix-fa7a48172a3c9d9c2f96d6f9c05d80f497bc304d.zip | |
Added pointer tracing, and fixes memeory leaks within a single run of cmix.
Diffstat (limited to 'libcmix')
| -rw-r--r-- | libcmix/cmix.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; |
