From 173841b53351f242f2ac69f7dd74d69cc959fd24 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 4 Mar 2023 20:14:09 +0100 Subject: [PATCH] fix CID #405231 - resource leak --- client/src/cmdhfmfhard.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/src/cmdhfmfhard.c b/client/src/cmdhfmfhard.c index 7d930a8a3..4cb7873af 100644 --- a/client/src/cmdhfmfhard.c +++ b/client/src/cmdhfmfhard.c @@ -1481,6 +1481,9 @@ static int acquire_nonces(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_ if (got_match == false) { PrintAndLogEx(FAILED, "No match for the First_Byte_Sum (%u), is the card a genuine MFC Ev1? ", first_byte_Sum); + if (nonce_file_write) { + fclose(fnonces); + } return PM3_EWRONGANSWER; }