From 9336d7c372fc09b9d46e30211ebf012d444f53e3 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Tue, 2 Dec 2014 10:50:27 +0100 Subject: [PATCH] e_start_main: Close fd only if we actually succeeded opening it. In the error case fd would be -1 here. Closing needs to be handled in the cases where fd != -1. CID: 1256492 --- src/bin/e_start_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c index ba6f30a35..e52ad51fb 100644 --- a/src/bin/e_start_main.c +++ b/src/bin/e_start_main.c @@ -413,8 +413,8 @@ _e_ptrace_kernel_check() { char c; ret = (read(fd, &c, sizeof (c)) == sizeof (c) && c != '0'); + close(fd); } - close(fd); return ret; #else return EINA_FALSE;