dtchat: do not disconnect a NULL XMPP connection (T4.6)

The adapter's exit path called xmpp_disconnect(conn) unconditionally; when the process ended before connecting (hello only, stdin closed), libstrophe crashed on the NULL connection. The call is now inside the existing conn != NULL branch, so the installed dtchat-xmpp answers hello and exits cleanly.
This commit is contained in:
lotherk committed 2026-11-17 12:48:01 +00:00
1 parent 2de121513b
commit 7597394ec2
1 file changed
+3 -2
+3 -2
View File
@@ -1559,9 +1559,10 @@ main(int argc, char **argv)
}
}
out:
xmpp_disconnect(conn);
if (conn != NULL)
if (conn != NULL) {
xmpp_disconnect(conn);
xmpp_conn_release(conn);
}
if (ctx != NULL)
xmpp_ctx_free(ctx);
xmpp_shutdown();