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); } }