mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 13:23:51 -07:00
Fix realloc mistake: ptr nulled but not freed upon failure
This commit is contained in:
parent
44c3a0a8aa
commit
19588b045f
1 changed files with 5 additions and 2 deletions
|
@ -260,9 +260,12 @@ int CmdFlashMemLoad(const char *Cmd) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
data = realloc(data, datalen);
|
uint8_t *newdata = realloc(data, datalen);
|
||||||
if (!data) {
|
if (newdata == NULL) {
|
||||||
|
free(data);
|
||||||
return 1;
|
return 1;
|
||||||
|
} else {
|
||||||
|
data = newdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Send to device
|
//Send to device
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue