gpg: Fix double free on error.

* g10/card-util.c (card_status): Check an error return.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-10-26 14:00:26 +09:00
parent 157f1de64e
commit a153d0f769
1 changed files with 2 additions and 1 deletions

View File

@ -740,7 +740,8 @@ card_status (ctrl_t ctrl, estream_t fp, const char *serialno)
/* Select the original card again. */
err = agent_scd_serialno (&serialno1, serialno0);
xfree (serialno1);
if (!err)
xfree (serialno1);
leave:
xfree (serialno0);