mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
fix resource leak
This commit is contained in:
parent
d782788e5b
commit
2c72763a5a
2 changed files with 12 additions and 3 deletions
|
@ -461,6 +461,7 @@ static int CmdrevengSearch(const char *Cmd) {
|
||||||
|
|
||||||
char *outHex = calloc(dataLen - crcChars + 1, sizeof(char));
|
char *outHex = calloc(dataLen - crcChars + 1, sizeof(char));
|
||||||
if (outHex == NULL) {
|
if (outHex == NULL) {
|
||||||
|
free(inCRC);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "nfc/ndef.h" // NDEFRecordsDecodeAndPrint
|
#include "nfc/ndef.h" // NDEFRecordsDecodeAndPrint
|
||||||
#include "cmdnfc.h" // print_type4_cc_info
|
#include "cmdnfc.h" // print_type4_cc_info
|
||||||
#include "fileutils.h" // saveFile
|
#include "fileutils.h" // saveFile
|
||||||
|
#include "atrs.h" // getATRinfo
|
||||||
|
|
||||||
static bool APDUInFramingEnable = true;
|
static bool APDUInFramingEnable = true;
|
||||||
|
|
||||||
|
@ -504,10 +505,11 @@ static int CmdHF14AReader(const char *Cmd) {
|
||||||
if (card.ats_len >= 3) { // a valid ATS consists of at least the length byte (TL) and 2 CRC bytes
|
if (card.ats_len >= 3) { // a valid ATS consists of at least the length byte (TL) and 2 CRC bytes
|
||||||
if (card.ats_len == card.ats[0] + 2)
|
if (card.ats_len == card.ats[0] + 2)
|
||||||
PrintAndLogEx(SUCCESS, " ATS: " _GREEN_("%s"), sprint_hex(card.ats, card.ats[0]));
|
PrintAndLogEx(SUCCESS, " ATS: " _GREEN_("%s"), sprint_hex(card.ats, card.ats[0]));
|
||||||
else
|
else {
|
||||||
PrintAndLogEx(SUCCESS, " ATS: [%d] " _GREEN_("%s"), card.ats_len, sprint_hex(card.ats, card.ats_len));
|
PrintAndLogEx(SUCCESS, " ATS: [%d] " _GREEN_("%s"), card.ats_len, sprint_hex(card.ats, card.ats_len));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!disconnectAfter) {
|
if (!disconnectAfter) {
|
||||||
if (!silent) PrintAndLogEx(SUCCESS, "Card is selected. You can now start sending commands");
|
if (!silent) PrintAndLogEx(SUCCESS, "Card is selected. You can now start sending commands");
|
||||||
}
|
}
|
||||||
|
@ -1992,7 +1994,13 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
if (card.ats[pos] == 0x80)
|
||||||
|
PrintAndLogEx(SUCCESS, " %s (compact TLV data object)", sprint_hex_inrow(card.ats + pos, calen));
|
||||||
|
else
|
||||||
PrintAndLogEx(SUCCESS, " %s", sprint_hex_inrow(card.ats + pos, calen));
|
PrintAndLogEx(SUCCESS, " %s", sprint_hex_inrow(card.ats + pos, calen));
|
||||||
|
|
||||||
|
PrintAndLogEx(NORMAL, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue