From 0849e2cac4e53d733a8bc1061c399169e1b810bd Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 27 Jul 2017 14:12:57 -0600 Subject: [PATCH] No need to call sudo_ev_del() before sudo_ev_free(); sudo_ev_free() will delete the event from its base before freeing it. --- src/exec_pty.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/exec_pty.c b/src/exec_pty.c index 3e19c1125..37eec07d1 100644 --- a/src/exec_pty.c +++ b/src/exec_pty.c @@ -269,7 +269,6 @@ log_ttyout(const char *buf, unsigned int n, struct io_buffer *iob) */ sudo_debug_printf(SUDO_DEBUG_INFO, "%s: deleting and freeing devtty wevent %p", __func__, iob->wevent); - sudo_ev_del(NULL, iob->wevent); sudo_ev_free(iob->wevent); iob->wevent = NULL; iob->off = iob->len = 0; @@ -313,7 +312,6 @@ log_stdout(const char *buf, unsigned int n, struct io_buffer *iob) */ sudo_debug_printf(SUDO_DEBUG_INFO, "%s: deleting and freeing stdout wevent %p", __func__, iob->wevent); - sudo_ev_del(NULL, iob->wevent); sudo_ev_free(iob->wevent); iob->wevent = NULL; iob->off = iob->len = 0; @@ -357,7 +355,6 @@ log_stderr(const char *buf, unsigned int n, struct io_buffer *iob) */ sudo_debug_printf(SUDO_DEBUG_INFO, "%s: deleting and freeing stderr wevent %p", __func__, iob->wevent); - sudo_ev_del(NULL, iob->wevent); sudo_ev_free(iob->wevent); iob->wevent = NULL; iob->off = iob->len = 0; @@ -1597,7 +1594,6 @@ ev_free_by_fd(struct sudo_event_base *evbase, int fd) sudo_debug_printf(SUDO_DEBUG_INFO, "%s: deleting and freeing revent %p with fd %d", __func__, iob->revent, fd); - sudo_ev_del(evbase, iob->revent); sudo_ev_free(iob->revent); iob->revent = NULL; } @@ -1607,7 +1603,6 @@ ev_free_by_fd(struct sudo_event_base *evbase, int fd) sudo_debug_printf(SUDO_DEBUG_INFO, "%s: deleting and freeing wevent %p with fd %d", __func__, iob->wevent, fd); - sudo_ev_del(evbase, iob->wevent); sudo_ev_free(iob->wevent); iob->wevent = NULL; } -- 2.40.0