Mustafa Bayar reported that when a ref points to a missing object, git-for-each-ref(1) may abort with "free(): double free detected in tcache 2" instead of reporting the missing object.

His analysis is that get_object() frees oi->content but leaves the pointer unchanged. The expand_data structures are reused across refs, so a later call can start with content pointing at a freed buffer. If the object lookup in that call fails before overwriting the pointer, the cleanup path frees the buffer again. The patch says a29e2e8fe (ref-filter: parse objects on demand, 2025-10-23) introduced this by making lookup failures jump to the cleanup label.

Karthik Nayak said he had reviewed the patch internally at GitLab, where it went through some iterations, so his reply was mostly a rubber stamp. Junio Hamano called the patch very well written, with the historical reference included, and said he will queue it and mark the topic ready for 'next'.