From 9644b6cb50ec01c04a0d6ab17a8e39054fd8b0f8 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 28 Mar 2008 15:49:13 +0100 Subject: Add a talloc context parameter to current_timestring() to fix memleaks. current_timestring used to return a string talloced to talloc_tos(). When called by DEBUG from a TALLOC_FREE, this produced messages "no talloc stackframe around, leaking memory". For example when used from net conf. This also adds a temporary talloc context to alloc_sub_basic(). For this purpose, the exit strategy is slightly altered: a common exit point is used for success and failure. Michael (This used to be commit 16b5800d4e3a8b88bac67b2550d14e0aaaa302a9) --- source3/smbd/change_trust_pw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/smbd') diff --git a/source3/smbd/change_trust_pw.c b/source3/smbd/change_trust_pw.c index fc58e97ea7..4773eeff86 100644 --- a/source3/smbd/change_trust_pw.c +++ b/source3/smbd/change_trust_pw.c @@ -90,7 +90,7 @@ NTSTATUS change_trust_account_password( const char *domain, const char *remote_m failed: if (!NT_STATUS_IS_OK(nt_status)) { DEBUG(0,("%s : change_trust_account_password: Failed to change password for domain %s.\n", - current_timestring(False), domain)); + current_timestring(debug_ctx(), False), domain)); } else DEBUG(5,("change_trust_account_password: sucess!\n")); -- cgit