chat_sync: fix double-free in auto_connect — clear ca_state in ac_result_cb on success
This commit is contained in:
1 parent
bfa3e666d4
commit
f3ac1cbb06
1 file changed
+1
-1
@@ -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) ── */
|
||||
|
||||
Reference in new issue
Block a user