From 54a4a5e2672bb22a80ad6271378252a35cf32cb1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 5 Jan 2009 13:36:34 +0100 Subject: [PATCH] Fix a bad memleak in vfs_full_audit (cherry picked from commit cc70e0f88328e36410089a81f41c5b33fef24a10) --- source/modules/vfs_full_audit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/modules/vfs_full_audit.c b/source/modules/vfs_full_audit.c index 68dd0b8d504..fd91bfe3d2b 100644 --- a/source/modules/vfs_full_audit.c +++ b/source/modules/vfs_full_audit.c @@ -701,6 +701,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", @@ -708,12 +709,14 @@ 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->user, conn->connectpath, conn->gid, get_current_username(), current_user_info.domain, prefix); + TALLOC_FREE(prefix); + return result; } static bool log_success(vfs_handle_struct *handle, vfs_op_type op) -- 2.11.4.GIT