From: Nikos Mavrogiannopoulos Date: Tue, 16 May 2017 13:25:28 +0000 (+0200) Subject: hogweed-benchmark: eliminated memory leak X-Git-Tag: nettle_3.4rc1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2e8df034c441b350ca46631ffbe9768a38147c9;p=thirdparty%2Fnettle.git hogweed-benchmark: eliminated memory leak Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/examples/hogweed-benchmark.c b/examples/hogweed-benchmark.c index 3fabe207..ebce9034 100644 --- a/examples/hogweed-benchmark.c +++ b/examples/hogweed-benchmark.c @@ -612,7 +612,10 @@ bench_openssl_ecdsa_init (unsigned size) /* This curve isn't supported in this build of openssl */ if (ctx->key == NULL) - return NULL; + { + free(ctx); + return NULL; + } if (!EC_KEY_generate_key( ctx->key)) die ("Openssl EC_KEY_generate_key failed.\n");