From 96108d826ab22d3409c24dfec4db1855bb1511f3 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 13 May 2020 12:24:28 +0200 Subject: [PATCH] fix coverity 286922 mem leak --- client/src/cmdhfmfdes.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index 5883f1675..7dad78f88 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -2474,7 +2474,11 @@ static int CmdHF14ADesWriteData(const char *Cmd) { PrintAndLogEx(ERR, "failed to allocate memory"); return PM3_EMALLOC; } - CLIGetHexWithReturn(4, data, &dlength); + if (CLIParamHexToBuf(arg_get_str(4), data, sizeof(data), &dlength)) { + free(data); + CLIParserFree(); + return PM3_ESOFT; + } int type = arg_get_int(5);