--- id: "bug-006" status: "fixed" status_updated: "2026-09-24" status_note: "" component: "controller" severity: "crash" timestamp: "2026-05-21T08:30:20.719Z" last_seen: "2026-09-19T09:00:00Z" occurrences: 2 files: ["src/controller/ha.c"] tags: ["md", "double-free", "asan", "ha_connect_to_peer", "endpoint_fini", "integration-test"] related: [] legacy: true --- # bug-006: AddressSanitizer: attempting double-free on sctx in ha_connect_to_peer ## Description AddressSanitizer: attempting double-free on sctx in ha_connect_to_peer ## Environment _Not recorded (migrated from buglog.json)._ ## Reproduction _Not recorded (migrated from buglog.json)._ ## Root cause endpoint_fini calls FREEUP(ep->data) which frees sctx, then ha_connect_to_peer also calls free(sctx) — double-free at lines 3594-3595 and 3600-3601 ## Fix Set ep->data = NULL before endpoint_fini so FREEUP becomes a no-op; then free(sctx) explicitly in the error paths ## Verification _Not recorded (migrated from buglog.json)._ ## References _Not recorded (migrated from buglog.json)._