diff options
author | Lukas Larsson <[email protected]> | 2019-03-11 15:24:43 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2019-03-25 13:36:24 +0100 |
commit | 38318c2131107e110c94d62d96431d5950a9d698 (patch) | |
tree | 94f8b534fdb5c6c7810a2db27d4877e2d371a99b /erts | |
parent | 04ebb0fbb74ae9332c75041ddc302697ceb1a01e (diff) | |
download | otp-38318c2131107e110c94d62d96431d5950a9d698.tar.gz otp-38318c2131107e110c94d62d96431d5950a9d698.tar.bz2 otp-38318c2131107e110c94d62d96431d5950a9d698.zip |
erts: Fix file desc leak in poll debug get_evts
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/sys/common/erl_poll.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/sys/common/erl_poll.c b/erts/emulator/sys/common/erl_poll.c index c71d23f58c..9662996039 100644 --- a/erts/emulator/sys/common/erl_poll.c +++ b/erts/emulator/sys/common/erl_poll.c @@ -2354,6 +2354,7 @@ uint32_t epoll_events(int kp_fd, int fd) fprintf(stderr,"failed to parse file %s on line %d, errno = %d\n", fname, line, errno); + fclose(f); return 0; } if (fd == ev_fd) { @@ -2408,6 +2409,7 @@ ERTS_POLL_EXPORT(erts_poll_get_selected_events)(ErtsPollSet *ps, if (fscanf(f,"pos:\t%x\nflags:\t%x", &pos, &flags) != 2) { fprintf(stderr,"failed to parse file %s, errno = %d\n", fname, errno); ASSERT(0); + fclose(f); return; } if (fscanf(f,"\nmnt_id:\t%x\n", &mnt_id)); @@ -2422,6 +2424,7 @@ ERTS_POLL_EXPORT(erts_poll_get_selected_events)(ErtsPollSet *ps, fprintf(stderr,"failed to parse file %s on line %d, errno = %d\n", fname, line, errno); ASSERT(0); + fclose(f); return; } if (fd == ps->wake_fds[0] || fd == ps->wake_fds[1]) @@ -2437,6 +2440,7 @@ ERTS_POLL_EXPORT(erts_poll_get_selected_events)(ErtsPollSet *ps, ev[fd] = (ERTS_POLL_EV_IN|ERTS_POLL_EV_OUT) & ERTS_POLL_EV_N2E(events); line++; } + fclose(f); #else for (fd = 0; fd < len; fd++) ev[fd] = ERTS_POLL_EV_NONE; |