vfs_fileid: fix get_connectpath_ino
[metze/samba/wip.git] / source3 / modules / vfs_fileid.c
index 5d08fe97d1552068b6b6886d447c65c2eae9efc1..cb77a2e52c627e0803c8e837f6ab8c98c76fc77b 100644 (file)
@@ -297,12 +297,14 @@ static int get_connectpath_ino(struct vfs_handle_struct *handle,
        }
 
        ret = SMB_VFS_NEXT_STAT(handle, fname);
-       TALLOC_FREE(fname);
        if (ret != 0) {
                DBG_ERR("stat failed for %s with %s\n",
                        handle->conn->connectpath, strerror(errno));
+               TALLOC_FREE(fname);
                return -1;
        }
+       *ino = fname->st.st_ex_ino;
+       TALLOC_FREE(fname);
 
        return 0;
 }