Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

fix(mcp): release path filter on search launch failure

Ertan8daa1120fa6b
diff --git a/src/mcp/mcp.c b/src/mcp/mcp.c
index 622a72f8b..d580fbdb3 100644
--- a/src/mcp/mcp.c
+++ b/src/mcp/mcp.c
@@ -9813,6 +9813,9 @@ static char *handle_search_code(cbm_mcp_server_t *srv, const char *args) {
FILE *fp = cbm_popen(cmd, "r");
if (!fp) {
search_scratch_close(&scratch);
+ if (has_path_filter) {
+ cbm_regfree(&path_regex);
+ }
free(root_path);
free(pattern);
free(project);