diff options
author | Jakub Jelen <[email protected]> | 2021-04-13 05:21:29 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2021-04-13 05:21:29 +0000 |
commit | 7cbe29c4fb4f593e194b6c25cb31633b4a6e0b2b (patch) | |
tree | c9e227fea15a5f08a6c6662dea052ee9611aaf39 /scd/apdu.c | |
parent | agent,kbx: Add LIBASSUAN_CLFAGS. (diff) | |
download | gnupg-7cbe29c4fb4f593e194b6c25cb31633b4a6e0b2b.tar.gz gnupg-7cbe29c4fb4f593e194b6c25cb31633b4a6e0b2b.zip |
scd: Fix memory leaks.
* scd/apdu.c (apdu_dev_list_start): Free DL.
* scd/app-nks.c (pubkey_from_pk_file): Fix typo in condition.
--
GnuPG-bug-id: 5393
Signed-off-by: Jakub Jelen <[email protected]>
Diffstat (limited to 'scd/apdu.c')
-rw-r--r-- | scd/apdu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scd/apdu.c b/scd/apdu.c index 2d77ae03f..10657102e 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -1985,6 +1985,7 @@ apdu_dev_list_start (const char *portstr, struct dev_list **l_p) err = ccid_dev_scan (&dl->idx_max, &dl->table); if (err) { + xfree (dl); npth_mutex_unlock (&reader_table_lock); return err; } @@ -2009,6 +2010,7 @@ apdu_dev_list_start (const char *portstr, struct dev_list **l_p) if (!pcsc.context) if (pcsc_init () < 0) { + xfree (dl); npth_mutex_unlock (&reader_table_lock); return gpg_error (GPG_ERR_NO_SERVICE); } @@ -2023,6 +2025,7 @@ apdu_dev_list_start (const char *portstr, struct dev_list **l_p) log_error ("error allocating memory for reader list\n"); close_pcsc_reader (0); + xfree (dl); npth_mutex_unlock (&reader_table_lock); return err; } @@ -2034,6 +2037,7 @@ apdu_dev_list_start (const char *portstr, struct dev_list **l_p) pcsc_error_string (r), r); xfree (p); close_pcsc_reader (0); + xfree (dl); npth_mutex_unlock (&reader_table_lock); return iso7816_map_sw (pcsc_error_to_sw (r)); } |