1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

agent: Fix an error path of agent_get_confirmation.

* agent/call-pinentry.c (agent_get_confirmation): Make sure
unlock_pinentry is always called.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2019-08-07 05:38:30 +09:00
parent f588dd8d17
commit bb82ad018a

View File

@ -1481,15 +1481,16 @@ agent_get_confirmation (ctrl_t ctrl,
npth_t thread; npth_t thread;
rc = watch_sock_start (&sock_watched, &thread); rc = watch_sock_start (&sock_watched, &thread);
if (rc) if (!rc)
return rc; {
rc = assuan_transact (entry_ctx, "CONFIRM",
NULL, NULL, NULL, NULL, NULL, NULL);
if (rc && gpg_err_source (rc)
&& gpg_err_code (rc) == GPG_ERR_ASS_CANCELED)
rc = gpg_err_make (gpg_err_source (rc), GPG_ERR_CANCELED);
rc = assuan_transact (entry_ctx, "CONFIRM", watch_sock_end (&sock_watched, &thread);
NULL, NULL, NULL, NULL, NULL, NULL); }
if (rc && gpg_err_source (rc) && gpg_err_code (rc) == GPG_ERR_ASS_CANCELED)
rc = gpg_err_make (gpg_err_source (rc), GPG_ERR_CANCELED);
watch_sock_end (&sock_watched, &thread);
return unlock_pinentry (ctrl, rc); return unlock_pinentry (ctrl, rc);
} }