[PATCH] Fix bug 13090

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Oct 17 11:46:22 UTC 2017


Hi!

Attached find a trivial cosmetic patch together with a bugfix for
13090.

Review appreciated!

Thanks, Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 755fb1de323ec30afe59926ddd48f3617acfe02c Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 17 Oct 2017 11:20:20 +0200
Subject: [PATCH 1/3] vfs_catia: Make "srt_head" static to the module

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/modules/vfs_catia.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index ce760ceefda..9651cd3bed3 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -53,7 +53,7 @@ struct catia_cache {
 	char *base_fname;
 };
 
-struct share_mapping_entry *srt_head = NULL;
+static struct share_mapping_entry *srt_head = NULL;
 
 static struct share_mapping_entry *get_srt(connection_struct *conn,
 					   struct share_mapping_entry **global)
-- 
2.11.0


From 113ae7be5932023002b0e5d4b56bb7f54a370295 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 17 Oct 2017 11:28:36 +0200
Subject: [PATCH 2/3] vfs_catia: Fix a memory leak

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13090
Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/modules/vfs_catia.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index 9651cd3bed3..878cd5ad05c 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -2406,6 +2406,7 @@ static NTSTATUS catia_readdir_attr(struct vfs_handle_struct *handle,
 	status = SMB_VFS_NEXT_READDIR_ATTR(handle, smb_fname, mem_ctx, pattr_data);
 
 	TALLOC_FREE(smb_fname);
+	TALLOC_FREE(fname);
 	return status;
 }
 
-- 
2.11.0


From 316893d7df4dfb3684f7b0d09cddd6b081c4d464 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Mon, 16 Oct 2017 17:43:09 +0200
Subject: [PATCH 3/3] vfs_catia: Fix a potential memleak

Together with the previous commit this fixes a memleak (twice) that
happens when vfs_catia is loaded with no mappings defined.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13090
Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/modules/vfs_catia.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index 878cd5ad05c..4088affc089 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -141,7 +141,7 @@ static NTSTATUS catia_string_replace_allocate(connection_struct *conn,
 
 	if (!init_mappings(conn, &selected)) {
 		/* No mappings found. Just use the old name */
-		*mapped_name = talloc_strdup(NULL, name_in);
+		*mapped_name = talloc_strdup(talloc_tos(), name_in);
 		if (!*mapped_name) {
 			errno = ENOMEM;
 			return NT_STATUS_NO_MEMORY;
-- 
2.11.0



More information about the samba-technical mailing list