diff options
author | NIIBE Yutaka <[email protected]> | 2020-10-26 05:00:26 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2020-10-26 05:00:26 +0000 |
commit | a153d0f7691486efe0aadfb1e226544ae6d20ffd (patch) | |
tree | 0f923a90a05cffdd7f60856b3d627ce4cfbdb9ff /g10/card-util.c | |
parent | gpg,tools: Fix detecting OpenPGP card by serialno. (diff) | |
download | gnupg-a153d0f7691486efe0aadfb1e226544ae6d20ffd.tar.gz gnupg-a153d0f7691486efe0aadfb1e226544ae6d20ffd.zip |
gpg: Fix double free on error.
* g10/card-util.c (card_status): Check an error return.
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'g10/card-util.c')
-rw-r--r-- | g10/card-util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/g10/card-util.c b/g10/card-util.c index 3f91fe78f..168427552 100644 --- a/g10/card-util.c +++ b/g10/card-util.c @@ -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); |