[SCM] Samba Shared Repository - branch master updated - 21b7b000fb53ac3025d0038cc551a47f9d4a743b

Volker Lendecke vlendec at samba.org
Mon Jan 5 12:42:54 GMT 2009


The branch, master has been updated
       via  21b7b000fb53ac3025d0038cc551a47f9d4a743b (commit)
       via  3305fa27987d250fe963ae24672dbd8a5b746b7d (commit)
      from  6d4fd789f65ea770a33abfcba42665cf6a0efb10 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 21b7b000fb53ac3025d0038cc551a47f9d4a743b
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jan 5 13:33:20 2009 +0100

    Use talloc_tos in vfs_full_audit.c:do_log

commit 3305fa27987d250fe963ae24672dbd8a5b746b7d
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jan 5 13:32:53 2009 +0100

    Fix a bad memleak in vfs_full_audit

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/vfs_full_audit.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index e4bda09..1d9983a 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -721,6 +721,7 @@ static int audit_syslog_priority(vfs_handle_struct *handle)
 static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn)
 {
 	char *prefix = NULL;
+	char *result;
 
 	prefix = talloc_strdup(ctx,
 			lp_parm_const_string(SNUM(conn), "full_audit",
@@ -728,7 +729,7 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn)
 	if (!prefix) {
 		return NULL;
 	}
-	return talloc_sub_advanced(ctx,
+	result = talloc_sub_advanced(ctx,
 			lp_servicename(SNUM(conn)),
 			conn->server_info->unix_name,
 			conn->connectpath,
@@ -736,6 +737,8 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn)
 			conn->server_info->sanitized_username,
 			pdb_get_domain(conn->server_info->sam_account),
 			prefix);
+	TALLOC_FREE(prefix);
+	return result;
 }
 
 static bool log_success(vfs_handle_struct *handle, vfs_op_type op)
@@ -849,14 +852,14 @@ static void do_log(vfs_op_type op, bool success, vfs_handle_struct *handle,
 		fstr_sprintf(err_msg, "fail (%s)", strerror(errno));
 
 	va_start(ap, format);
-	op_msg = talloc_vasprintf(NULL, format, ap);
+	op_msg = talloc_vasprintf(talloc_tos(), format, ap);
 	va_end(ap);
 
 	if (!op_msg) {
 		return;
 	}
 
-	audit_pre = audit_prefix(NULL, handle->conn);
+	audit_pre = audit_prefix(talloc_tos(), handle->conn);
 	syslog(audit_syslog_priority(handle), "%s|%s|%s|%s\n",
 		audit_pre ? audit_pre : "",
 		audit_opname(op), err_msg, op_msg);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list