Check for a valid resource to bind before checking its length.

This commit is contained in:
Ralph Giles
2005-06-15 17:15:43 +00:00
parent 76e0c6a4b3
commit 1a655d515f

View File

@@ -531,7 +531,7 @@ static int _handle_features_sasl(xmpp_conn_t * const conn,
/* request a specific resource if we have one */
resource = xmpp_jid_resource(conn->ctx, conn->jid);
if (strlen(resource) == 0) {
if ((resource != NULL) && (strlen(resource) == 0)) {
/* j2 doesn't handle an empty resource */
xmpp_free(conn->ctx, resource);
resource = NULL;