From 7ec08238340d954606222671a482e0ebff9c2c89 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Mon, 23 Oct 2017 14:13:49 +0200 Subject: [PATCH] keyring: fix forgotten check --- src/keyring.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/keyring.h b/src/keyring.h index 4f0ebbd..df7a6ef 100644 --- a/src/keyring.h +++ b/src/keyring.h @@ -183,7 +183,8 @@ public: void remove_keypair (const std::string&keyid) { if (pairs.count (keyid)) { sencode_destroy (pairs[keyid].pub.key); - sencode_destroy (pairs[keyid].privkey); + if (pairs[keyid].privkey) + sencode_destroy (pairs[keyid].privkey); pairs.erase (keyid); } }