From 374fb6906fe866ca28f7c4702db1d1eec7dedd08 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 31 Oct 2013 17:53:17 +0100 Subject: file-utils: Don't leaking fd on error path in gs_file_create() This error was found by running Coverity. Signed-off-by: Thomas Haller --- gsystem-file-utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gsystem-file-utils.c b/gsystem-file-utils.c index 41cd769..ff97e19 100644 --- a/gsystem-file-utils.c +++ b/gsystem-file-utils.c @@ -345,6 +345,7 @@ gs_file_create (GFile *file, if (fchmod (fd, mode) < 0) { + close (fd); _set_error_from_errno (error); goto out; } -- cgit v1.2.1