mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
fix a few cppcheck warnings
This commit is contained in:
parent
d97f417ee6
commit
3aeb5c493f
13 changed files with 44 additions and 41 deletions
|
@ -304,12 +304,13 @@ static bool ensure_buckets_alloc(size_t need_buckets) {
|
|||
while (need_buckets > alloc_sz) {
|
||||
alloc_sz *= 2;
|
||||
}
|
||||
|
||||
buckets = realloc(buckets, sizeof(statelist_t *) * alloc_sz);
|
||||
if (buckets == NULL) {
|
||||
statelist_t **new_buckets = realloc(buckets, sizeof(statelist_t *) * alloc_sz);
|
||||
if (new_buckets == NULL) {
|
||||
free(buckets);
|
||||
buckets_allocated = 0;
|
||||
return false;
|
||||
}
|
||||
buckets = new_buckets;
|
||||
memset(buckets + buckets_allocated, 0, (alloc_sz - buckets_allocated) * sizeof(statelist_t *));
|
||||
buckets_allocated = alloc_sz;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue