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; }