From cdf920b2894c6db8e91b44c6af5dcd75d1e209c5 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 8 Apr 2020 14:18:21 +0200 Subject: [PATCH] coverity fix --- client/cmdhflegic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index 088800780..5c007f9f9 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -662,6 +662,8 @@ static int CmdLegicWrbl(const char *Cmd) { // OUT-OF-BOUNDS checks // UID 4+1 bytes can't be written to. if (offset < 5) { + if (data) + free(data); PrintAndLogEx(WARNING, "Out-of-bounds, bytes 0-1-2-3-4 can't be written to. Offset = %d", offset); return PM3_EOUTOFBOUND; }