From 7597394ec246d04592b29ecfc5f2d8b132de40af Mon Sep 17 00:00:00 2001 From: lotherk Date: Tue, 17 Nov 2026 12:48:01 +0000 Subject: [PATCH] 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. --- ext/src/mcde/programs/dtchat/xmpp_adapter.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/src/mcde/programs/dtchat/xmpp_adapter.c b/ext/src/mcde/programs/dtchat/xmpp_adapter.c index 2597ac93ab..babf8c7c30 100644 --- a/ext/src/mcde/programs/dtchat/xmpp_adapter.c +++ b/ext/src/mcde/programs/dtchat/xmpp_adapter.c @@ -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();