From ee78af33fe5c9d84de35bbb0687b6d185abc8cf6 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Oct 2013 17:11:16 +0200 Subject: ntvfs: Fix Coverity ID 1107224 Resource leak In this error path we were leaking "fd". Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source4/ntvfs/posix/pvfs_open.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index a095f74633..ceee64255f 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -717,7 +717,9 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs, if (io->generic.in.query_maximal_access) { status = pvfs_access_maximal_allowed(pvfs, req, name, &io->generic.out.maximal_access); - NT_STATUS_NOT_OK_RETURN(status); + if (!NT_STATUS_IS_OK(status)) { + goto cleanup_delete; + } } /* form the lock context used for byte range locking and -- cgit