aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2011-04-20 09:33:09 +0000
committerMarcus Brinkmann <[email protected]>2011-04-20 09:33:09 +0000
commit70b871abbc4ec0968152968c10269cee72286df3 (patch)
tree80745794fa04bb7ba2a1d66e46b1df06b46af2c9
parentAnother PASSWD --preset fix. (diff)
downloadgnupg-70b871abbc4ec0968152968c10269cee72286df3.tar.gz
gnupg-70b871abbc4ec0968152968c10269cee72286df3.zip
Fix gpg-agent secure memory leak in OpenPGP private key import.
2011-04-20 Marcus Brinkmann <[email protected]> * command.c (cmd_import_key): Release key from failed import before converting openpgp private key in the openpgp-private-key case.
Diffstat (limited to '')
-rw-r--r--agent/ChangeLog6
-rw-r--r--agent/command.c2
2 files changed, 8 insertions, 0 deletions
diff --git a/agent/ChangeLog b/agent/ChangeLog
index e8570f7a4..e342b571f 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-20 Marcus Brinkmann <[email protected]>
+
+ * command.c (cmd_import_key): Release key from failed import
+ before converting openpgp private key in the openpgp-private-key
+ case.
+
2011-04-17 Ben Kibbey <[email protected]>
* command.c (cmd_passwd): Check for an error before presetting.
diff --git a/agent/command.c b/agent/command.c
index 9f45afbb0..34617ade7 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -1827,6 +1827,8 @@ cmd_import_key (assuan_context_t ctx, char *line)
used to protect the key using the same code as for regular
key import. */
+ xfree (key);
+ key = NULL;
err = convert_from_openpgp (ctrl, openpgp_sexp, grip,
ctrl->server_local->keydesc, cache_nonce,
&key, &passphrase);