diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source3/torture/cmd_vfs.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-4.0.0alpha16.tar.gz samba-4.0.0alpha16.tar.xz samba-4.0.0alpha16.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16samba-4.0.0alpha16
Diffstat (limited to 'source3/torture/cmd_vfs.c')
-rw-r--r-- | source3/torture/cmd_vfs.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 2c3a4160024..9527a34af4d 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -57,7 +57,7 @@ static NTSTATUS cmd_populate(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int arg } c = argv[1][0]; size = atoi(argv[2]); - vfs->data = TALLOC_ARRAY(mem_ctx, char, size); + vfs->data = talloc_array(mem_ctx, char, size); if (vfs->data == NULL) { printf("populate: error=-1 (not enough memory)"); return NT_STATUS_UNSUCCESSFUL; @@ -435,7 +435,7 @@ static NTSTATUS cmd_read(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c /* do some error checking on these */ fd = atoi(argv[1]); size = atoi(argv[2]); - vfs->data = TALLOC_ARRAY(mem_ctx, char, size); + vfs->data = talloc_array(mem_ctx, char, size); if (vfs->data == NULL) { printf("read: error=-1 (not enough memory)"); return NT_STATUS_UNSUCCESSFUL; @@ -889,13 +889,14 @@ static NTSTATUS cmd_fchown(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, static NTSTATUS cmd_getwd(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv) { - char buf[PATH_MAX]; - if (SMB_VFS_GETWD(vfs->conn, buf) == NULL) { + char *buf = SMB_VFS_GETWD(vfs->conn); + if (buf == NULL) { printf("getwd: error=%d (%s)\n", errno, strerror(errno)); return NT_STATUS_UNSUCCESSFUL; } printf("getwd: %s\n", buf); + SAFE_FREE(buf); return NT_STATUS_OK; } |