There may be a memory leak in main in /src/tools/sceac-example.c

When failed to access reader, cxt needs to be released before
exiting the program. Like in the patch of CVE-2019-6502, a
sc_release_context(ctx) is needed before line 71, or a
memory leak may occur.
This commit is contained in:
Zhang Xiaohui 2020-10-16 10:10:55 +08:00 committed by Frank Morgner
parent 7551e14c58
commit 0dc3dcbc00
1 changed files with 1 additions and 0 deletions

View File

@ -68,6 +68,7 @@ main (int argc, char **argv)
reader = sc_ctx_get_reader(ctx, 0);
if (!reader) {
fprintf(stderr, "Failed to access reader 0");
sc_release_context(ctx);
exit(1);
}