mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
chg: converting some more malloc calls -> calloc
This commit is contained in:
parent
939b727c42
commit
faa6ece881
3 changed files with 4 additions and 4 deletions
|
@ -113,7 +113,7 @@ static int build_segs_from_phdrs(flash_file_t *ctx, FILE *fd, Elf32_Phdr *phdrs,
|
|||
uint32_t new_length = this_end - prev_seg->start;
|
||||
uint32_t this_offset = paddr - prev_seg->start;
|
||||
uint32_t hole = this_offset - prev_seg->length;
|
||||
uint8_t *new_data = malloc(new_length);
|
||||
uint8_t *new_data = calloc(new_length, sizeof(uint8_t));
|
||||
if (!new_data) {
|
||||
fprintf(stderr, "Out of memory\n");
|
||||
free(data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue