From 31c5722ac0fcd73c4f3b88cd2f6ea7f3f403ecdd Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 8 Apr 2021 10:38:10 +0200 Subject: [PATCH] fix coverity CID 317343,317344 ... --- client/src/cmdhficlass.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index a40affc42..aff0be344 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -243,6 +243,7 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke if (got_kr == false) { PrintAndLogEx(ERR, "please specifiy KEYROLL key!"); + free(data); return PM3_EINVARG; } @@ -269,6 +270,7 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke PrintAndLogEx(INFO, "Detecting cardhelper..."); if (IsCardHelperPresent(false) == false) { PrintAndLogEx(FAILED, "failed to detect cardhelper"); + free(data); return PM3_ENODATA; } @@ -335,6 +337,7 @@ static int generate_config_card(const iclass_config_card_item_t *o, uint8_t *ke saveFileJSON(filename, jsfIclass, data, tot_bytes, NULL); PrintAndLogEx(HINT, "Try `" _YELLOW_("hf iclass view -f %s.bin") "` to view dump file", filename); + free(data); return PM3_SUCCESS; }