From: iceman1001 Date: Thu, 18 Feb 2016 19:39:41 +0000 (+0100) Subject: FIX: resource leak, forgot a free X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/eb5206bd209dd91acd469d21658b3dd2313c0be7?hp=1abd86f17ab419d36195eb77979c6b2958b0ea60 FIX: resource leak, forgot a free --- diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index 361efdc9..7b58567f 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -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 );