X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/aacb96d7ed1723663fddd4e2611c22c971442cbd..e3f9c50d81680809c6cdb821dee419a666ecd2c3:/client/cmdhflegic.c?ds=sidebyside diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index ab9df487..7b58567f 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -424,13 +424,16 @@ int CmdLegicRfFill(const char *Cmd) { int CmdLegicCalcCrc8(const char *Cmd){ int len = strlen(Cmd); - if (len & 1 ) return usage_legic_calccrc8(); + if ( len & 1 ) return usage_legic_calccrc8(); // add 1 for null terminator. 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 );