From b067a5e4e83556d11a68ea1837ce4698762c123d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 3 Nov 2009 10:59:18 +0100 Subject: s3: Remove debug_ctx() smbd just crashed on me: In a debug message I called a routine preparing a string that itself used debug_ctx. The outer routine also used it after the inner routine had returned. It was still referencing the talloc context that the outer debug_ctx() had given us, which the inner DEBUG had already freed. --- source3/smbd/filename_util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/smbd/filename_util.c') diff --git a/source3/smbd/filename_util.c b/source3/smbd/filename_util.c index 8c099657c4..aad8a08e2b 100644 --- a/source3/smbd/filename_util.c +++ b/source3/smbd/filename_util.c @@ -107,7 +107,7 @@ NTSTATUS create_synthetic_smb_fname_split(TALLOC_CTX *ctx, } /** - * Return a string using the debug_ctx() + * Return a string using the talloc_tos() */ const char *smb_fname_str_dbg(const struct smb_filename *smb_fname) { @@ -117,7 +117,7 @@ const char *smb_fname_str_dbg(const struct smb_filename *smb_fname) if (smb_fname == NULL) { return ""; } - status = get_full_smb_filename(debug_ctx(), smb_fname, &fname); + status = get_full_smb_filename(talloc_tos(), smb_fname, &fname); if (!NT_STATUS_IS_OK(status)) { return ""; } @@ -125,7 +125,7 @@ const char *smb_fname_str_dbg(const struct smb_filename *smb_fname) } /** - * Return a debug string using the debug_ctx(). This can only be called from + * Return a debug string using the talloc_tos(). This can only be called from * DEBUG() macros due to the debut_ctx(). */ const char *fsp_str_dbg(const struct files_struct *fsp) -- cgit