Browse Source

chat_sync: fix double-free in auto_connect — clear ca_state in ac_result_cb on success

topo_upd
Evgeny 3 months ago
parent
commit
f3ac1cbb06
  1. 2
      tools/chatgui/transport/chat_sync.c

2
tools/chatgui/transport/chat_sync.c

@ -199,7 +199,7 @@ static void ac_result_cb(int result, uint64_t node_id, void* arg) {
if (!g_ac || !g_ac->active) return;
const char* rs = result == CONN_MGR_OK ? "OK" : "FAIL";
DEBUG_INFO(DEBUG_CATEGORY_CONNECTIVITY, "%s: result node=0x%016llx %s", AC_ID, (unsigned long long)node_id, rs);
/* DON'T clear ca_state — GC will close connection and free slot after AC_GC_TIMEOUT_MS */
if (result == CONN_MGR_OK) f->ca_state = NULL; /* already freed by ca_ready_cb, prevent double-free in GC/stop */
}
/* ── retry timer callback (every AC_RETRY_MS) ── */

Loading…
Cancel
Save