mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07: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);
|
uint8_t *data = malloc(len+1);
|
||||||
if ( data == NULL ) return 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);
|
uint32_t checksum = CRC8Legic(data, len/2);
|
||||||
PrintAndLog("Bytes: %s || CRC8: %X", sprint_hex(data, len/2), checksum );
|
PrintAndLog("Bytes: %s || CRC8: %X", sprint_hex(data, len/2), checksum );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue