mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
cppcheck memory leak
This commit is contained in:
parent
1aa8ae6076
commit
b2a7a91bbd
1 changed files with 9 additions and 0 deletions
|
@ -458,7 +458,16 @@ int main(int argc, char *argv[]) {
|
|||
// threads
|
||||
for (int i = 0; i < thread_count; ++i) {
|
||||
targs *a = calloc(1, rng.len + sizeof(targs));
|
||||
if (a == NULL) {
|
||||
printf("Memory allocation failed for thread arguments\n");
|
||||
exit(1);
|
||||
}
|
||||
a->r.data = calloc(1, rng.len);
|
||||
if (a->r.data == NULL) {
|
||||
printf("Memory allocation failed for rng data\n");
|
||||
free(a);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
a->thread = i;
|
||||
a->idx = i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue