e_start_main: Close fd only if we actually succeeded opening it.
authorStefan Schmidt <s.schmidt@samsung.com>
Tue, 2 Dec 2014 09:50:27 +0000 (10:50 +0100)
committerStefan Schmidt <s.schmidt@samsung.com>
Tue, 2 Dec 2014 09:50:27 +0000 (10:50 +0100)
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

index ba6f30a..e52ad51 100644 (file)
@@ -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;