From 283da8ece01938da0bbf279050870cb017cd704f Mon Sep 17 00:00:00 2001
From: Nikos Mavrogiannopoulos <nmav@redhat.com>
Date: Tue, 16 May 2017 15:25:28 +0200
Subject: [PATCH 4/4] hogweed-benchmark: eliminated memory leak

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
---
 examples/hogweed-benchmark.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/examples/hogweed-benchmark.c b/examples/hogweed-benchmark.c
index 3fabe20..ebce903 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");
-- 
2.9.3

