reftable/table: release filter on error path
`reftable_table_refs_for_unindexed()` allocates a filtering_ref_iterator and then calls `reftable_buf_add()` to populate its oid buffer. On success ownership is transferred to the output iterator, but if `reftable_buf_add()` fails, the goto-out cleanup only frees the table iterator and walks away from both the filter allocation and the oid buffer that `reftable_buf_add()` may have grown. Release filter->oid and free filter alongside the existing table iterator cleanup. Reported by Coverity as CID 1671512 ("Resource leak"). Assisted-by: Opus 4.7 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Jul 5, 2026 at 08:24 UTC
b3b1d83f366c6f0db13e7d9679b762334a97d847
1 file changed
+4
reftable/table.c
+4
@@ -709,6 +709,10 @@ out:
709
if (ti)
710
table_iter_close(ti);
711
reftable_free(ti);
712
+ if (filter) {
713
+ reftable_buf_release(&filter->oid);
714
+ reftable_free(filter);
715
+ }
716
}
717
return err;
718
}