diff --git a/src/conn.c b/src/conn.c index f4e19a7..bea84eb 100644 --- a/src/conn.c +++ b/src/conn.c @@ -264,6 +264,8 @@ int xmpp_conn_release(xmpp_conn_t * const conn) } } + _conn_reset(conn); + /* free handler stuff * note that userdata is the responsibility of the client * and the handler pointers don't need to be freed since they @@ -305,7 +307,6 @@ int xmpp_conn_release(xmpp_conn_t * const conn) } parser_free(conn->parser); - _conn_reset(conn); if (conn->jid) xmpp_free(ctx, conn->jid); if (conn->pass) xmpp_free(ctx, conn->pass); diff --git a/src/handler.c b/src/handler.c index 8a9e179..1f5dbaa 100644 --- a/src/handler.c +++ b/src/handler.c @@ -686,4 +686,5 @@ void handler_system_delete_all(xmpp_conn_t *conn) xmpp_free(conn->ctx, key2); } } + if (iter) hash_iter_release(iter); }