mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-20 22:24:10 +08:00
FIX: CoverityScan 123465 - Resource leak
This commit is contained in:
parent
5147ec6959
commit
0892708119
1 changed files with 3 additions and 0 deletions
|
@ -575,6 +575,9 @@ int CmdLegicCalcCrc8(const char *Cmd){
|
||||||
switch(param_getchar(Cmd, cmdp)) {
|
switch(param_getchar(Cmd, cmdp)) {
|
||||||
case 'b':
|
case 'b':
|
||||||
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);
|
data = malloc(len);
|
||||||
if ( data == NULL ) {
|
if ( data == NULL ) {
|
||||||
PrintAndLog("Can't allocate memory. exiting");
|
PrintAndLog("Can't allocate memory. exiting");
|
||||||
|
|
Loading…
Reference in a new issue