mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-12-04 04:37:20 +08:00
cbm_gbuf_insert_edge ignored a failed cbm_da_push: it registered the edge in the dedup and secondary indexes and returned a positive id while the primary array, which the dump and free read, did not hold it. A retry then hit the dedup entry and appeared to succeed, so the edge was lost and leaked. Compare the count around the append; on failure free the edge and return 0 before any index registration. Pinned by gbuf_edge_append_oom_is_not_success, which fails the edge array's first growth through a new test-only, one-shot, class-filtered realloc failure hook (cbm_mem_test_fail_next_realloc, compiled only with CBM_MEM_TEST_API in the test and TSan flag sets). Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>