Skip to content

pr-2332/tetsuo/submit/refs-debug-iterator-v1

tagged this 26 Nov 03:37
From: =?UTF-8?q?Onur=20G=C3=BCnd=C3=BCz?= <ogunduz@gmail.com>

Commit cec2b6f55a (refs/iterator: separate lifecycle from iteration,
2025-03-12) moved deallocation of ref iterators from the backend
callbacks to ref_iterator_free(). However, the debug iterator still
calls the wrapped iterator's release callback directly. This frees
its backend-specific resources but leaks the iterator itself.

Call ref_iterator_free() instead so that both the resources and the
wrapped iterator are freed.

Add a test that compares reference iteration with tracing enabled
and disabled. Without the fix, the traced invocation leaks under
LeakSanitizer with both the files and reftable backends.

Signed-off-by: Onur Gündüz <ogunduz@gmail.com>

Submitted-As: https://lore.kernel.org/git/pull.2332.git.1795664263318.gitgitgadget@gmail.com
Assets 2
Loading