From 83162c5c87e88a5f911ca5349320938a52dbc1df Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Mon, 22 Mar 2021 15:53:35 +0100 Subject: [PATCH] fixed memory leak fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32324 sc_enum_apps() causes card->cache.current_ef to be allocated for IAS/ECC, but not freed if any other error occurs during initialization. since sc_enum_apps() is called anyway during PKCS#15 initialization. Having this at the card driver level (instead of the PKCS#15 level) is not needed. --- src/libopensc/card-iasecc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libopensc/card-iasecc.c b/src/libopensc/card-iasecc.c index 6520275b..95746b9b 100644 --- a/src/libopensc/card-iasecc.c +++ b/src/libopensc/card-iasecc.c @@ -644,8 +644,6 @@ iasecc_init_cpx(struct sc_card *card) _sc_card_add_rsa_alg(card, 1024, flags, 0); _sc_card_add_rsa_alg(card, 2048, flags, 0); - LOG_TEST_RET(ctx, sc_enum_apps(card), "Enumerate apps failed"); - LOG_FUNC_RETURN(ctx, SC_SUCCESS); }