summaryrefslogtreecommitdiffstats
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-11-10 19:41:15 +0100
committerIra Cooper <ira@samba.org>2013-11-11 21:04:09 +0100
commitb7420e44b1f7e0e0f54cf9f329981bacf839f7c9 (patch)
tree68595819184ab83e9f05ed290cfef8507e72d04c /source4/ntvfs
parent144428058a73b059d7389915e310ff48fd591e59 (diff)
downloadsamba-b7420e44b1f7e0e0f54cf9f329981bacf839f7c9.tar.gz
samba-b7420e44b1f7e0e0f54cf9f329981bacf839f7c9.tar.xz
samba-b7420e44b1f7e0e0f54cf9f329981bacf839f7c9.zip
ntvfs: Fix CID 1034883 Resource leak
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/simple/vfs_simple.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/ntvfs/simple/vfs_simple.c b/source4/ntvfs/simple/vfs_simple.c
index 58c8df8dd53..a652494dc17 100644
--- a/source4/ntvfs/simple/vfs_simple.c
+++ b/source4/ntvfs/simple/vfs_simple.c
@@ -414,7 +414,10 @@ do_open:
NT_STATUS_NOT_OK_RETURN(status);
f = talloc(handle, struct svfs_file);
- NT_STATUS_HAVE_NO_MEMORY(f);
+ if (f == NULL) {
+ close(fd);
+ return NT_STATUS_NO_MEMORY;
+ }
f->fd = fd;
f->name = talloc_strdup(f, unix_path);
NT_STATUS_HAVE_NO_MEMORY(f->name);