use calloc()
This commit is contained in:
1 parent
584e0ad833
commit
182d167aad
1 file changed
+1
-1
@@ -4102,7 +4102,7 @@ int CmdHF14MfuNDEFRead(const char *Cmd) {
|
||||
// utility function. Retrieves emulator memory
|
||||
static int GetMfuDumpFromEMul(mfu_dump_t **buf) {
|
||||
|
||||
uint8_t *dump = malloc(sizeof(mfu_dump_t));
|
||||
uint8_t *dump = calloc(MFU_MAX_BYTES + MFU_DUMP_PREFIX_LENGTH, sizeof(uint8_t));
|
||||
if (dump == NULL) {
|
||||
PrintAndLogEx(WARNING, "Fail, cannot allocate memory");
|
||||
return PM3_EMALLOC;
|
||||
|
||||
Reference in new issue
Block a user