handler: fix memory leak and use-after-free errors
The errors are related to newly added handler_system_delete_all().
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -686,4 +686,5 @@ void handler_system_delete_all(xmpp_conn_t *conn)
|
||||
xmpp_free(conn->ctx, key2);
|
||||
}
|
||||
}
|
||||
if (iter) hash_iter_release(iter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user