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:
1 parent
5a07cc7938
commit
a1403f5177
1 file changed
+3
-2
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user