aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--agent/command.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/agent/command.c b/agent/command.c
index f4bd1824f..48b4a1e93 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -3251,6 +3251,12 @@ cmd_keytocard (assuan_context_t ctx, char *line)
force = has_option (line, "--force");
line = skip_options (line);
+ /* Need a copy of LINE, since it might inquire to the frontend which
+ resulted original buffer overwritten. */
+ line = xtrystrdup (line);
+ if (!line)
+ return gpg_error_from_syserror ();
+
argc = split_fields (line, argv, DIM (argv));
if (argc < 3)
{
@@ -3370,6 +3376,7 @@ cmd_keytocard (assuan_context_t ctx, char *line)
xfree (keydata);
leave:
+ xfree (line);
xfree (ecdh_params);
gcry_sexp_release (s_skey);
xfree (shadow_info);