From 490418d6363d2735cd1d801f7b2bb804eb85b197 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 10 Nov 2013 19:45:11 +0100 Subject: gpo: Fix CID 1034880 Resource leak Signed-off-by: Volker Lendecke Reviewed-by: Ira Cooper Autobuild-User(master): Ira Cooper Autobuild-Date(master): Mon Nov 11 22:59:10 CET 2013 on sn-devel-104 --- source4/lib/policy/gp_filesys.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/lib/policy') 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)) { -- cgit v1.2.1