diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-05-23 13:24:34 +0200 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2014-05-24 00:45:57 +0400 |
commit | 124fe7fb1b7a1db8cb2ebb9edae84716ffaf37ce (patch) | |
tree | 1e7c634cb81b4184c5accad9609bf596e93bc74b | |
parent | d357e3d9d24c8a9e99c994c3c1ee5acb32484a3d (diff) |
libcacard: Plug memory leaks around vreader_get_reader_list()
Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r-- | libcacard/vcard_emul_nss.c | 4 | ||||
-rw-r--r-- | libcacard/vscclient.c | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/libcacard/vcard_emul_nss.c b/libcacard/vcard_emul_nss.c index 75b9d79412..78265932fa 100644 --- a/libcacard/vcard_emul_nss.c +++ b/libcacard/vcard_emul_nss.c @@ -433,11 +433,13 @@ vcard_emul_find_vreader_from_slot(PK11SlotInfo *slot) VReader *reader = vreader_list_get_reader(current_entry); VReaderEmul *reader_emul = vreader_get_private(reader); if (reader_emul->slot == slot) { + vreader_list_delete(reader_list); return reader; } vreader_free(reader); } + vreader_list_delete(reader_list); return NULL; } @@ -1059,6 +1061,8 @@ vcard_emul_replay_insertion_events(void) next_entry = vreader_list_get_next(current_entry); vreader_queue_card_event(vreader); } + + vreader_list_delete(list); } /* diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c index 29f4958089..f2a753a417 100644 --- a/libcacard/vscclient.c +++ b/libcacard/vscclient.c @@ -570,6 +570,7 @@ do_command(GIOChannel *source, "CARD_PRESENT" : " ", vreader_get_name(reader)); } + vreader_list_delete(list); } else if (*string != 0) { printf("valid commands:\n"); printf("insert [reader_id]\n"); |