mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
chg: converting malloc calls -> calloc which zeros out the allocated memory
This commit is contained in:
parent
989b80007c
commit
939b727c42
9 changed files with 55 additions and 50 deletions
|
@ -481,7 +481,7 @@ int CmdTraceList(const char *Cmd) {
|
|||
// reserv some space.
|
||||
if (!trace) {
|
||||
printf("trace pointer not allocated\n");
|
||||
trace = malloc(USB_CMD_DATA_SIZE);
|
||||
trace = calloc(USB_CMD_DATA_SIZE, sizeof(uint8_t));
|
||||
}
|
||||
|
||||
if ( isOnline ) {
|
||||
|
@ -571,8 +571,8 @@ int CmdTraceLoad(const char *Cmd) {
|
|||
if ( trace )
|
||||
free(trace);
|
||||
|
||||
trace = malloc(fsize);
|
||||
if (trace == NULL) {
|
||||
trace = calloc(fsize, sizeof(uint8_t));
|
||||
if (!trace) {
|
||||
PrintAndLogEx(FAILED, "Cannot allocate memory for trace");
|
||||
fclose(f);
|
||||
return 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue