From 351ca44e8b3ea8336abba8215dfc1ccb42458384 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 Sep 2004 04:20:18 +0000 Subject: r2674: I have realised that talloc() should have its context marked const, as a const pointer really means that "the data pointed to by this pointer won't change", and that is certainly true of talloc(). The fact that some behind-the-scenes meta-data can change doesn't matter from the point of view of const. this fixes a number of const warnings caused by const data structures being passed as talloc contexts. That will no longer generate a warning. also changed the talloc leak reporting option from --leak-check to --leak-report, as all it does is generate a report on exit. A new --leak-report-full option has been added that shows the complete tree of memory allocations, which is is quite useful in tracking things down. NOTE: I find it quite useful to insert talloc_report_full(ptr, stderr) calls at strategic points in the code while debugging memory allocation problems, particularly before freeing a major context (such as the connection context). This allows you to see if that context has been accumulating too much data, such as per-request data, which should have been freed when the request finished. (This used to be commit c60ff99c3129c26a9204bac1c6e5fb386114a923) --- source4/auth/auth_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/auth/auth_util.c') diff --git a/source4/auth/auth_util.c b/source4/auth/auth_util.c index 4f56776c96..652c157c7a 100644 --- a/source4/auth/auth_util.c +++ b/source4/auth/auth_util.c @@ -421,7 +421,7 @@ NTSTATUS create_nt_user_token(TALLOC_CTX *mem_ctx, Make a user_info struct ***************************************************************************/ -NTSTATUS make_server_info(TALLOC_CTX *mem_ctx, +NTSTATUS make_server_info(const TALLOC_CTX *mem_ctx, struct auth_serversupplied_info **server_info, const char *username) { @@ -437,7 +437,7 @@ NTSTATUS make_server_info(TALLOC_CTX *mem_ctx, /*************************************************************************** Make (and fill) a user_info struct for a guest login. ***************************************************************************/ -NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx, struct auth_serversupplied_info **server_info) +NTSTATUS make_server_info_guest(const TALLOC_CTX *mem_ctx, struct auth_serversupplied_info **server_info) { NTSTATUS nt_status; static const char zeros[16]; -- cgit