mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
fix: 'lf hitag sim' - mem leaks
fix: 'lf hitag cc' - mem leaks
This commit is contained in:
parent
1f8040596f
commit
cbab48659e
1 changed files with 14 additions and 2 deletions
|
@ -277,6 +277,7 @@ int CmdLFHitagSim(const char *Cmd) {
|
|||
while (param_getchar(Cmd, cmdp) != 0x00 && !errors) {
|
||||
switch (tolower(param_getchar(Cmd, cmdp))) {
|
||||
case 'h':
|
||||
free(data);
|
||||
return usage_hitag_sim();
|
||||
case '2':
|
||||
maxdatalen = 48;
|
||||
|
@ -326,7 +327,10 @@ int CmdLFHitagSim(const char *Cmd) {
|
|||
}
|
||||
|
||||
//Validations
|
||||
if (errors || cmdp == 0) return usage_hitag_sim();
|
||||
if (errors || cmdp == 0) {
|
||||
free(data);
|
||||
return usage_hitag_sim();
|
||||
}
|
||||
|
||||
c.arg[0] = (uint32_t)tag_mem_supplied;
|
||||
if ( tag_mem_supplied ) {
|
||||
|
@ -334,6 +338,8 @@ int CmdLFHitagSim(const char *Cmd) {
|
|||
}
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
|
||||
free(data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -438,6 +444,7 @@ int CmdLFHitagCheckChallenges(const char *Cmd) {
|
|||
while (param_getchar(Cmd, cmdp) != 0x00 && !errors) {
|
||||
switch (tolower(param_getchar(Cmd, cmdp))) {
|
||||
case 'h':
|
||||
free(data);
|
||||
return usage_hitag_checkchallenges();
|
||||
case 'f':
|
||||
param_getstr(Cmd, cmdp+1, filename, sizeof(filename));
|
||||
|
@ -459,12 +466,17 @@ int CmdLFHitagCheckChallenges(const char *Cmd) {
|
|||
}
|
||||
|
||||
//Validations
|
||||
if (errors) return usage_hitag_checkchallenges();
|
||||
if (errors) {
|
||||
free(data);
|
||||
return usage_hitag_checkchallenges();
|
||||
}
|
||||
|
||||
//file with all the challenges to try
|
||||
c.arg[0] = (uint32_t)file_given;
|
||||
clearCommandBuffer();
|
||||
SendCommand(&c);
|
||||
|
||||
free(data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue