]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_catia: Fix a potential memleak
authorVolker Lendecke <vl@samba.org>
Mon, 16 Oct 2017 15:43:09 +0000 (17:43 +0200)
committerKarolin Seeger <kseeger@samba.org>
Wed, 25 Oct 2017 10:49:19 +0000 (12:49 +0200)
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@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 17 18:53:48 CEST 2017 on sn-devel-144

(cherry picked from commit f6d6af3b2d5efcd160c1e5e09778fb1129530be0)

Autobuild-User(v4-6-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-6-test): Wed Oct 25 12:49:20 CEST 2017 on sn-devel-144

source3/modules/vfs_catia.c

index 3eb64bd14773c5594ae2cad6f2ed6b4eb9e1a860..2b118a6d6a8ad806e9aabdb566c11d26b456e560 100644 (file)
@@ -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;