From: Volker Lendecke Date: Tue, 11 Feb 2020 20:47:39 +0000 (+0100) Subject: lib: Add a TALLOC_CTX to base register_msg_pool_usage() on X-Git-Tag: ldb-2.1.1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dab982d88e9132cbff52db22f441c08ee59bb159;p=thirdparty%2Fsamba.git lib: Add a TALLOC_CTX to base register_msg_pool_usage() on Add a simple way to deactivate the registration Bug: https://bugzilla.samba.org/show_bug.cgi?id=14281 Signed-off-by: Volker Lendecke Reviewed-by: Martin Schwenke Reviewed-by: Stefan Metzmacher --- diff --git a/source3/include/proto.h b/source3/include/proto.h index e03486f07ab..6ac70a22beb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -266,7 +266,8 @@ bool getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user, /* The following definitions come from lib/tallocmsg.c */ -void register_msg_pool_usage(struct messaging_context *msg_ctx); +void register_msg_pool_usage(TALLOC_CTX *mem_ctx, + struct messaging_context *msg_ctx); /* The following definitions come from lib/time.c */ diff --git a/source3/lib/messages.c b/source3/lib/messages.c index a6bf99578b6..065ccd3a262 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -590,7 +590,7 @@ static NTSTATUS messaging_init_internal(TALLOC_CTX *mem_ctx, /* Register some debugging related messages */ - register_msg_pool_usage(ctx); + register_msg_pool_usage(ctx, ctx); register_dmalloc_msgs(ctx); debug_register_msgs(ctx); diff --git a/source3/lib/tallocmsg.c b/source3/lib/tallocmsg.c index 9cef2a8e10b..bc0fa132e32 100644 --- a/source3/lib/tallocmsg.c +++ b/source3/lib/tallocmsg.c @@ -69,12 +69,13 @@ static bool pool_usage_filter(struct messaging_rec *rec, void *private_data) /** * Register handler for MSG_REQ_POOL_USAGE **/ -void register_msg_pool_usage(struct messaging_context *msg_ctx) +void register_msg_pool_usage( + TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx) { struct tevent_req *req = NULL; req = messaging_filtered_read_send( - msg_ctx, + mem_ctx, messaging_tevent_context(msg_ctx), msg_ctx, pool_usage_filter,