From e42e8e4c92f7f0fcf45e4ad3df56e862aac247f3 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 2 Jun 2020 11:02:23 +0200 Subject: [PATCH] fix coverity 290267 --- client/src/cmdhf14a.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index b293e4c01..baa2c66cf 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -912,6 +912,7 @@ static int CmdHF14AAPDU(const char *Cmd) { makeAPDU = headerlen > 0; if (makeAPDU && headerlen != 4) { PrintAndLogEx(ERR, "header length must be 4 bytes instead of %d", headerlen); + CLIParserFree(ctx); return 1; } extendedAPDU = arg_get_lit(6); @@ -937,24 +938,27 @@ static int CmdHF14AAPDU(const char *Cmd) { if (APDUEncode(&apdu, data, &datalen)) { PrintAndLogEx(ERR, "can't make apdu with provided parameters."); + CLIParserFree(ctx); return 2; } } else { if (extendedAPDU) { PrintAndLogEx(ERR, "make mode not set but here `e` option."); + CLIParserFree(ctx); return 3; } if (le > 0) { PrintAndLogEx(ERR, "make mode not set but here `l` option."); + CLIParserFree(ctx); return 3; } // len = data + PCB(1b) + CRC(2b) CLIGetHexBLessWithReturn(ctx, 8, data, &datalen, 1 + 2); } - CLIParserFree(ctx); + PrintAndLogEx(NORMAL, ">>>>[%s%s%s] %s", activateField ? "sel " : "", leaveSignalON ? "keep " : "", decodeTLV ? "TLV" : "", sprint_hex(data, datalen)); if (decodeAPDU) {