From f6ae161fd504b5b39ee1c4db46b541b8f6b7f456 Mon Sep 17 00:00:00 2001 From: Sonic803 Date: Wed, 21 Feb 2024 12:42:54 +0100 Subject: [PATCH] Free in case of write error --- client/src/cmdhf14b.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/cmdhf14b.c b/client/src/cmdhf14b.c index 44ffa5d15..8787f4d17 100644 --- a/client/src/cmdhf14b.c +++ b/client/src/cmdhf14b.c @@ -1923,7 +1923,8 @@ static int CmdHF14BRestore(const char *Cmd) { int status = write_sr_block(blockno, 4, data+blockno*4); if (status != PM3_SUCCESS) { - PrintAndLogEx(FAILED, "Write failed shutting down"); + PrintAndLogEx(FAILED, "Write failed"); + free(data); return status; }