Small memory leak fix (CVE-2019-6502 in #1586)

CVE-2019-6502 was assigned to what appears to be a very minor
memory leak that only occurs on an error-case in a CLI tool.
If util_connect_card fails, we still need to release the sc
context previously allocated by sc_context_create else memory
will leak.
This commit is contained in:
Scott Gayou 2019-03-01 13:11:06 -06:00 committed by Frank Morgner
parent 19c5ab315d
commit 0d79675497
1 changed files with 1 additions and 0 deletions

View File

@ -403,6 +403,7 @@ int main(int argc, char **argv)
r = util_connect_card(ctx, &card, opt_reader, opt_wait, 0);
if (r) {
fprintf(stderr, "Failed to connect to card: %s\n", sc_strerror(r));
sc_release_context(ctx);
return 1;
}