From 141316c3725fe9328d347683a4dd7b6ed3ba7531 Mon Sep 17 00:00:00 2001 From: merlokk Date: Tue, 9 Oct 2018 19:14:17 +0300 Subject: [PATCH] small fix in memory management logic --- client/emv/cmdemv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/emv/cmdemv.c b/client/emv/cmdemv.c index 0f5906ac..b6a7e310 100644 --- a/client/emv/cmdemv.c +++ b/client/emv/cmdemv.c @@ -1208,12 +1208,13 @@ int CmdHFEMVScan(const char *cmd) { // check search and select application id TLVPrintAIDlistFromSelectTLV(tlvSelect); } - tlvdb_free(tlvSelect); // EMV SELECT application SetAPDULogging(showAPDU); EMVSelectApplication(tlvSelect, AID, &AIDlen); + tlvdb_free(tlvSelect); + if (!AIDlen) { PrintAndLog("Can't select AID. EMV AID not found. Exit..."); return 4;