mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-19 05:33:17 +08:00
FIX: resource leak, forgot a free
This commit is contained in:
parent
1abd86f17a
commit
eb5206bd20
1 changed files with 4 additions and 1 deletions
|
@ -430,7 +430,10 @@ int CmdLegicCalcCrc8(const char *Cmd){
|
|||
uint8_t *data = malloc(len+1);
|
||||
if ( data == NULL ) return 1;
|
||||
|
||||
if (param_gethex(Cmd, 0, data, len )) return usage_legic_calccrc8();
|
||||
if (param_gethex(Cmd, 0, data, len )) {
|
||||
free(data);
|
||||
return usage_legic_calccrc8();
|
||||
}
|
||||
|
||||
uint32_t checksum = CRC8Legic(data, len/2);
|
||||
PrintAndLog("Bytes: %s || CRC8: %X", sprint_hex(data, len/2), checksum );
|
||||
|
|
Loading…
Reference in a new issue