diff options
Diffstat (limited to '')
-rw-r--r-- | g10/card-util.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/g10/card-util.c b/g10/card-util.c index e79e9e508..f3ede6d46 100644 --- a/g10/card-util.c +++ b/g10/card-util.c @@ -787,7 +787,8 @@ static int change_name (void) { char *surname = NULL, *givenname = NULL; - char *isoname, *p; + char *isoname = NULL; + char *p; int rc; surname = get_one_name ("keygen.smartcard.surname", @@ -798,7 +799,8 @@ change_name (void) { xfree (surname); xfree (givenname); - return -1; /*canceled*/ + rc = gpg_error (GPG_ERR_CANCELED); + goto leave; } isoname = xmalloc ( strlen (surname) + 2 + strlen (givenname) + 1); @@ -814,14 +816,17 @@ change_name (void) tty_printf (_("Error: Combined name too long " "(limit is %d characters).\n"), 39); xfree (isoname); - return -1; + rc = gpg_error (GPG_ERR_TOO_LARGE); + goto leave; } rc = agent_scd_setattr ("DISP-NAME", isoname, strlen (isoname)); if (rc) log_error ("error setting Name: %s\n", gpg_strerror (rc)); + leave: xfree (isoname); + write_sc_op_status (rc); return rc; } |