]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
hogweed-benchmark: eliminated memory leak
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Tue, 16 May 2017 13:25:28 +0000 (15:25 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 16 May 2017 20:51:38 +0000 (22:51 +0200)
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
examples/hogweed-benchmark.c

index 3fabe20719a3ac52958695febfddf0f757f6eed7..ebce9034125bbcb9f8d872900c90deae7c6846a6 100644 (file)
@@ -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");