From 76aaffbebca42217825feeeb874a717c4150fe18 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Mon, 2 Nov 2026 21:22:44 +0100 Subject: [PATCH] fix(resolver): delete the cursor of the OCaml structure walk ocaml_collect_structure created a tree cursor and had no ts_tree_cursor_delete at all. Its one exit after the cursor is the fall-through at the end of the loop, so every struct of every OCaml file leaked one. LeakSanitizer on Linux reported it at adapter_ocaml.c:603 from resolver_source_langs. The other three cursors in the file are already paired. Signed-off-by: Martin Vogel --- internal/cbm/resolve/adapter_ocaml.c | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/cbm/resolve/adapter_ocaml.c b/internal/cbm/resolve/adapter_ocaml.c index 18f1be309..1ca9e2674 100644 --- a/internal/cbm/resolve/adapter_ocaml.c +++ b/internal/cbm/resolve/adapter_ocaml.c @@ -664,6 +664,7 @@ static void ocaml_collect_structure(cbm_source_walk_t *walk, const char *owner, } } } + ts_tree_cursor_delete(&cursor); } /* Where this file stands among the modules of its build. */