From fea3185922d51a3432938010ad269ecf5aa466f7 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 1 Jan 2020 21:28:02 +0100 Subject: [PATCH] cppcheck --- client/emv/emvcore.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/emv/emvcore.c b/client/emv/emvcore.c index c18521b6c..74b78f797 100644 --- a/client/emv/emvcore.c +++ b/client/emv/emvcore.c @@ -490,10 +490,10 @@ int EMVSearchPSE(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldO for (uint8_t ui = 0x01; ui <= 0x10; ui++) { if (sfidatalen[ui]) { - struct tlvdb *tsfi = NULL; - tsfi = tlvdb_parse_multi(sfidata[ui], sfidatalen[ui]); - if (tsfi) { - struct tlvdb *tsfitmp = tlvdb_find_path(tsfi, (tlv_tag_t[]) {0x70, 0x61, 0x00}); + + struct tlvdb *tsfi_a = tlvdb_parse_multi(sfidata[ui], sfidatalen[ui]); + if (tsfi_a) { + struct tlvdb *tsfitmp = tlvdb_find_path(tsfi_a, (tlv_tag_t[]) {0x70, 0x61, 0x00}); if (!tsfitmp) { PrintAndLogEx(FAILED, "SFI 0x%02zu doesn't have any records.", sfidatalen[ui]); continue; @@ -501,7 +501,7 @@ int EMVSearchPSE(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldO res = EMVCheckAID(channel, decodeTLV, tsfitmp, tlv); fileFound = true; } - tlvdb_free(tsfi); + tlvdb_free(tsfi_a); } } }