#include <stdio.h>\r
#include <stdlib.h>\r
#include <ctype.h>\r
-#include "proxmark3.h"\r
+#include "comms.h"\r
#include "cmdmain.h"\r
#include "cmdhfmfhard.h"\r
#include "parity.h"\r
blockNo = i * 4;\r
keyType = j;\r
num_to_bytes(e_sector[i].Key[j], 6, key);\r
- \r
keyFound = true;\r
break;\r
}\r
// Can't found a key....\r
if (!keyFound) {\r
PrintAndLog("Can't found any of the known keys.");\r
+ free(e_sector);\r
return 4;\r
}\r
PrintAndLog("--auto key. block no:%3d, key type:%c key:%s", blockNo, keyType?'B':'A', sprint_hex(key, 6));\r
\r
// initialize storage for found keys\r
e_sector = calloc(SectorsCnt, sizeof(sector_t));\r
- if (e_sector == NULL) return 1;\r
+ if (e_sector == NULL) {\r
+ free(keyBlock);\r
+ return 1;\r
+ }\r
for (uint8_t keyAB = 0; keyAB < 2; keyAB++) {\r
for (uint16_t sectorNo = 0; sectorNo < SectorsCnt; sectorNo++) {\r
e_sector[sectorNo].Key[keyAB] = 0xffffffffffff;\r
\r
int CmdHFMF(const char *Cmd)\r
{\r
- // flush\r
- WaitForResponseTimeout(CMD_ACK,NULL,100);\r
-\r
- CmdsParse(CommandTable, Cmd);\r
- return 0;\r
+ (void)WaitForResponseTimeout(CMD_ACK,NULL,100);\r
+ CmdsParse(CommandTable, Cmd);\r
+ return 0;\r
}\r
\r
int CmdHelp(const char *Cmd)\r