From: Alexis Green Date: Tue, 2 Aug 2016 20:57:44 +0000 (-0700) Subject: FIX: CoverityScan 123465 - Resource leak X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/0892708119735d1f3720700a8334a35bc37706c0?ds=sidebyside;hp=5147ec695991384578073c93d65e268f852b59c7 FIX: CoverityScan 123465 - Resource leak --- diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index 731cead1..d55ea98d 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -575,6 +575,9 @@ int CmdLegicCalcCrc8(const char *Cmd){ switch(param_getchar(Cmd, cmdp)) { case 'b': case 'B': + // it's possible for user to accidentally enter "b" parameter + // more than once - we have to clean previous malloc + if (data) free(data); data = malloc(len); if ( data == NULL ) { PrintAndLog("Can't allocate memory. exiting");