From: Stefan Schmidt Date: Tue, 2 Dec 2014 09:50:27 +0000 (+0100) Subject: e_start_main: Close fd only if we actually succeeded opening it. X-Git-Tag: upstream/0.19.99~411 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9336d7c372fc09b9d46e30211ebf012d444f53e3;p=platform%2Fupstream%2Fenlightenment.git 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 --- diff --git a/src/bin/e_start_main.c b/src/bin/e_start_main.c index ba6f30a..e52ad51 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;