From 213600d7326565e5ab34b93cfd13baf56f144ca6 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Sun, 21 Apr 2013 14:25:26 +0200 Subject: [PATCH] actions: don't leak sencode --- src/actions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/actions.cpp b/src/actions.cpp index 0d1e323..9d40500 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -89,6 +89,7 @@ int action_gen_key (const std::string& algspec, const std::string&name, } KR.store_keypair (keyring::get_keyid (pub), name, algname, pub, priv); + //pub&priv data will get destroyed along with keyring if (!KR.save() ) { err ("error: couldn't save keyring"); @@ -242,6 +243,7 @@ int action_export (bool armor, sencode*S = keyring::serialize_pubkeys (s); if (!S) return 1; std::string data = S->encode(); + sencode_destroy (S); if (armor) { std::vector parts; @@ -398,6 +400,7 @@ int action_export_sec (bool armor, sencode*S = keyring::serialize_keypairs (s); if (!S) return 1; //weird. std::string data = S->encode(); + sencode_destroy (S); if (armor) { std::vector parts;