From 13bb29a38640fa207cc4ebbafff086046fcc8a76 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 5 Feb 2018 22:59:49 +0100 Subject: [PATCH] fix: 'hf mf fchk' - releasing memory when finished is a good thing --- armsrc/mifarecmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index e242aa03a..6f753432b 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -1217,6 +1217,8 @@ void MifareChkKeys_fast(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *da static uint8_t found[80]; static uint8_t *uid; + iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN); + if (uid == NULL || firstchunk) { uid = BigBuf_malloc(10); if (uid == NULL ) { @@ -1228,8 +1230,6 @@ void MifareChkKeys_fast(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *da LEDsoff(); LED_A_ON(); - iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN); - if ( firstchunk ) { clear_trace(); @@ -1416,6 +1416,7 @@ OUT: set_tracing(false); FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF); + BigBuf_free(); BigBuf_Clear_ext(false); } else { // partial/none keys found cmd_send(CMD_ACK, foundkeys, 0, 0, 0, 0);