mirror of
https://github.com/samba-team/samba.git
synced 2025-08-12 01:49:28 +03:00
s4:ldap_server: introduce a ldapsrv_call_destructor()
This makes sure that a call doesn't become an stale member of the conn->pending_calls list. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
ace49db796
commit
82929a4bdd
@ -254,6 +254,18 @@ failed:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int ldapsrv_call_destructor(struct ldapsrv_call *call)
|
||||
{
|
||||
if (call->conn == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DLIST_REMOVE(call->conn->pending_calls, call);
|
||||
|
||||
call->conn = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct tevent_req *ldapsrv_process_call_send(TALLOC_CTX *mem_ctx,
|
||||
struct tevent_context *ev,
|
||||
struct tevent_queue *call_queue,
|
||||
@ -504,6 +516,7 @@ static void ldapsrv_call_read_done(struct tevent_req *subreq)
|
||||
ldapsrv_terminate_connection(conn, "no memory");
|
||||
return;
|
||||
}
|
||||
talloc_set_destructor(call, ldapsrv_call_destructor);
|
||||
|
||||
call->conn = conn;
|
||||
|
||||
|
Reference in New Issue
Block a user