mirror of https://github.com/mkerrisk/man-pages
seccomp_unotify.2: EXAMPLES: fix a file descriptor leak
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
8760bd15a1
commit
f8899e1c88
|
@ -1464,7 +1464,7 @@ getTargetPathname(struct seccomp_notif *req, int notifyFd,
|
|||
then read() on that file descriptor will return 0 (EOF). */
|
||||
|
||||
if (!cookieIsValid(notifyFd, req\->id)) {
|
||||
perror("\etS: notification ID check failed!!!");
|
||||
close(procMemFd);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1480,8 +1480,7 @@ getTargetPathname(struct seccomp_notif *req, int notifyFd,
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (close(procMemFd) == \-1)
|
||||
errExit("Supervisor: close\-/proc/PID/mem");
|
||||
close(procMemFd);
|
||||
|
||||
/* Once again check that the notification ID is still valid. The
|
||||
case we are particularly concerned about here is that just
|
||||
|
|
Loading…
Reference in New Issue