summaryrefslogtreecommitdiff
path: root/source4/lib/policy
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-11-10 19:45:11 +0100
committerIra Cooper <ira@samba.org>2013-11-11 22:59:10 +0100
commit490418d6363d2735cd1d801f7b2bb804eb85b197 (patch)
tree75b0c05086e2c8af67869b9c1da2a17bacda7876 /source4/lib/policy
parent4d97b5dcca827d6767857182772f4ced0fdd5da7 (diff)
downloadsamba-490418d6363d2735cd1d801f7b2bb804eb85b197.tar.gz
gpo: Fix CID 1034880 Resource leak
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org> Autobuild-User(master): Ira Cooper <ira@samba.org> Autobuild-Date(master): Mon Nov 11 22:59:10 CET 2013 on sn-devel-104
Diffstat (limited to 'source4/lib/policy')
-rw-r--r--source4/lib/policy/gp_filesys.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source4/lib/policy/gp_filesys.c b/source4/lib/policy/gp_filesys.c
index a528a2ece9a..b6107fceae7 100644
--- a/source4/lib/policy/gp_filesys.c
+++ b/source4/lib/policy/gp_filesys.c
@@ -563,14 +563,13 @@ NTSTATUS gp_create_gpt(struct gp_context *gp_ctx, const char *name,
}
rv = write(fd, file_content, strlen(file_content));
+ close(fd);
if (rv != strlen(file_content)) {
DEBUG(0, ("Short write in GPT.INI\n"));
talloc_free(mem_ctx);
return NT_STATUS_UNSUCCESSFUL;
}
- close(fd);
-
/* Upload the GPT to the sysvol share on a DC */
status = gp_push_gpt(gp_ctx, policy_dir, file_sys_path);
if (!NT_STATUS_IS_OK(status)) {