From 21de7a265bed95d1034ee8087ffbd754b7fe95cd Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 3 Jan 2020 18:07:31 +0100 Subject: [PATCH] covery 265055, 265056, 265059 resource leak --- client/cmdhfmf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 9b43f5a3d..a8960d5d0 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -1799,6 +1799,7 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) { // create/initialize key storage structure int32_t res = initSectorTable(&e_sector, sectors_cnt); if (res != sectors_cnt) { + free(e_sector); return PM3_EMALLOC; } @@ -3644,8 +3645,10 @@ static int CmdHF14AMfEKeyPrn(const char *Cmd) { // create/initialize key storage structure int32_t res = initSectorTable(&e_sector, sectors_cnt); - if (res != sectors_cnt) + if (res != sectors_cnt) { + free(e_sector); return PM3_EMALLOC; + } // read UID from EMUL if (mfEmlGetMem(data, 0, 1) != PM3_SUCCESS) { @@ -4083,6 +4086,7 @@ static int CmdHF14AMfCSave(const char *Cmd) { PacketResponseNG resp; if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) { PrintAndLogEx(WARNING, "iso14443a card select failed"); + free(dump); return PM3_ESOFT; }