fix coverity 290965

This commit is contained in:
iceman1001 2020-06-29 10:32:35 +02:00
commit 29a4a888a4

View file

@ -3216,24 +3216,20 @@ static int CmdHF14ADesFormatPICC(const char *Cmd) {
"\n\thf mfdes formatpicc\n" "\n\thf mfdes formatpicc\n"
"Make sure to authenticate picc before running this command.\n" "Make sure to authenticate picc before running this command.\n"
); );
CLIParserFree(ctx);
sAPDU apdu = {0x90, MFDES_FORMAT_PICC, 0x00, 0x00, 0, NULL}; // 0xDF sAPDU apdu = {0x90, MFDES_FORMAT_PICC, 0x00, 0x00, 0, NULL}; // 0xDF
uint16_t sw = 0; uint16_t sw = 0;
uint32_t recvlen = 0; uint32_t recvlen = 0;
int res = send_desfire_cmd(&apdu, false, NULL, &recvlen, &sw, 0, true); int res = send_desfire_cmd(&apdu, false, NULL, &recvlen, &sw, 0, true);
if (res != PM3_SUCCESS) { if (res != PM3_SUCCESS) {
PrintAndLogEx(WARNING, _RED_(" Can't format picc -> %s"), GetErrorString(res, &sw)); PrintAndLogEx(WARNING, _RED_(" Can't format picc -> %s"), GetErrorString(res, &sw));
DropField();
return res;
} else { } else {
PrintAndLogEx(INFO, "Card successfully reset"); PrintAndLogEx(INFO, "Card successfully reset");
return PM3_SUCCESS;
} }
DropField(); DropField();
return PM3_SUCCESS; return res;
} }
static int CmdHF14ADesInfo(const char *Cmd) { static int CmdHF14ADesInfo(const char *Cmd) {
(void)Cmd; // Cmd is not used so far (void)Cmd; // Cmd is not used so far
DropField(); DropField();
@ -3372,7 +3368,6 @@ static int CmdHF14ADesInfo(const char *Cmd) {
return PM3_SUCCESS; return PM3_SUCCESS;
} }
static void DecodeFileType(uint8_t filetype) { static void DecodeFileType(uint8_t filetype) {
switch (filetype) { switch (filetype) {
case 0x00: case 0x00: