From c01cd3cb3784cecf54727bb037defe0b4f671c78 Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Mon, 25 Apr 2016 20:22:02 +0200
Subject: Applied the libssl official example completely to prevent a crash in
 some cases.

---
 ChangeLog                | 5 +++++
 src/analysis/db/keymgn.c | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index a7a149f..3719707 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+16-04-25  Cyrille Bagard <nocbos@gmail.com>
+
+	* src/analysis/db/keymgn.c:
+	Apply the libssl official example completely to prevent a crash in some cases.
+
 16-04-24  Cyrille Bagard <nocbos@gmail.com>
 
 	* src/gtkext/gtkdockable.c:
diff --git a/src/analysis/db/keymgn.c b/src/analysis/db/keymgn.c
index bce2ce8..42056f0 100644
--- a/src/analysis/db/keymgn.c
+++ b/src/analysis/db/keymgn.c
@@ -129,6 +129,8 @@ static bool generate_user_rsa_keys(const char *priv, const char *pub)
     ret = EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, RSA_USED_SIZE * 8);
     if (ret != 1) goto euhrk_exit;
 
+    pair = NULL;
+
     ret = EVP_PKEY_keygen(ctx, &pair);
     if (ret != 1) goto euhrk_exit;
 
-- 
cgit v0.11.2-87-g4458