summaryrefslogtreecommitdiff
path: root/source3/torture/cmd_vfs.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-07-10 18:11:32 -0700
committerTim Prouty <tprouty@samba.org>2009-07-20 17:26:57 -0700
commitc9b8a017147211d86662f40dcf835b152ab90cf4 (patch)
tree8b234318da33165a45422b4a09cb5fd3dacd2507 /source3/torture/cmd_vfs.c
parent5a8d70d465f28ae02f4df7a3c2905e028c2e3142 (diff)
downloadsamba-c9b8a017147211d86662f40dcf835b152ab90cf4.tar.gz
samba-c9b8a017147211d86662f40dcf835b152ab90cf4.tar.bz2
samba-c9b8a017147211d86662f40dcf835b152ab90cf4.zip
s3: Finish plumbing the fsp->fsp_name smb_fname conversion through the modules.
Diffstat (limited to 'source3/torture/cmd_vfs.c')
-rw-r--r--source3/torture/cmd_vfs.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index 33ced8fa54..cd550a4f48 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -317,11 +317,6 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
if (fsp == NULL) {
return NT_STATUS_NO_MEMORY;
}
- fsp->fsp_name = SMB_STRDUP(argv[1]);
- if (fsp->fsp_name == NULL) {
- SAFE_FREE(fsp);
- return NT_STATUS_NO_MEMORY;
- }
fsp->fh = SMB_MALLOC_P(struct fd_handle);
if (fsp->fh == NULL) {
SAFE_FREE(fsp->fsp_name);
@@ -333,18 +328,18 @@ static NTSTATUS cmd_open(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
status = create_synthetic_smb_fname_split(mem_ctx, argv[1], NULL,
&smb_fname);
if (!NT_STATUS_IS_OK(status)) {
- SAFE_FREE(fsp->fsp_name);
SAFE_FREE(fsp);
return status;
}
+ fsp->fsp_name = smb_fname;
+
fsp->fh->fd = SMB_VFS_OPEN(vfs->conn, smb_fname, fsp, flags, mode);
- TALLOC_FREE(smb_fname);
if (fsp->fh->fd == -1) {
printf("open: error=%d (%s)\n", errno, strerror(errno));
SAFE_FREE(fsp->fh);
- SAFE_FREE(fsp->fsp_name);
SAFE_FREE(fsp);
+ TALLOC_FREE(smb_fname);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -415,7 +410,7 @@ static NTSTATUS cmd_close(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
else
printf("close: ok\n");
- SAFE_FREE(vfs->files[fd]->fsp_name);
+ TALLOC_FREE(vfs->files[fd]->fsp_name);
SAFE_FREE(vfs->files[fd]->fh);
SAFE_FREE(vfs->files[fd]);
vfs->files[fd] = NULL;