]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs_fileid: fix a use after free
authorRalph Boehme <slow@samba.org>
Sat, 6 Jan 2018 15:13:52 +0000 (16:13 +0100)
committerRalph Boehme <slow@samba.org>
Mon, 8 Jan 2018 02:16:30 +0000 (03:16 +0100)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Jan  8 03:16:30 CET 2018 on sn-devel-144

source3/modules/vfs_fileid.c

index 98cc32d62d5d18420080480767840e1ba2526792..c890876c998e4c7b17a1efc51d09b72a3fbdcaa7 100644 (file)
@@ -233,9 +233,11 @@ static uint64_t fileid_device_mapping_hostname(struct fileid_handle_data *data,
                return UINT64_MAX;
        }
        devname_len = talloc_array_length(devname) - 1;
-       TALLOC_FREE(devname);
 
        id = fileid_uint64_hash((uint8_t *)devname, devname_len);
+
+       TALLOC_FREE(devname);
+
        return id;
 }