mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-10-17 19:29:58 +00:00
save_graphbuffer() and save_buffer8() calloc a copy, and the restore_*() helpers only copy out of it, so every owner leaked its save state. check_chiptype() lost 4 * g_GraphTraceLen bytes plus the packed demod buffer on each online `lf search` (~2 MB after the COTAG probe), and the Visa2000 demod leaked on every `lf search`, online or offline. Add free_buffer_savestate() and call it after the last restore in check_chiptype(), demodTI(), demodVisa2k(), demodzx(), try_detect_modulation() and t55xx_psk_untrim_head(), including the early-return and success paths that never restored. Reported with the check_chiptype() diagnosis and fix by @BeheSQ. Fixes #3675 Co-Authored-By: Grok Bot <noreply@users.noreply.github.com>