mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-04 20:13:38 +08:00
fix resource leak
This commit is contained in:
parent
d782788e5b
commit
2c72763a5a
2 changed files with 12 additions and 3 deletions
|
@ -454,13 +454,14 @@ static int CmdrevengSearch(const char *Cmd) {
|
|||
memset(result, 0, 30);
|
||||
char *inCRC = calloc(crcChars + 1, sizeof(char));
|
||||
if (inCRC == NULL) {
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
memcpy(inCRC, inHexStr + (dataLen - crcChars), crcChars);
|
||||
|
||||
char *outHex = calloc(dataLen - crcChars + 1, sizeof(char));
|
||||
if (outHex == NULL) {
|
||||
free(inCRC);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "nfc/ndef.h" // NDEFRecordsDecodeAndPrint
|
||||
#include "cmdnfc.h" // print_type4_cc_info
|
||||
#include "fileutils.h" // saveFile
|
||||
#include "atrs.h" // getATRinfo
|
||||
|
||||
static bool APDUInFramingEnable = true;
|
||||
|
||||
|
@ -504,8 +505,9 @@ 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 == card.ats[0] + 2)
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!disconnectAfter) {
|
||||
|
@ -1992,7 +1994,13 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
|
|||
break;
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(SUCCESS, " %s", sprint_hex_inrow(card.ats + pos, calen));
|
||||
|
||||
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(NORMAL, "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue