From a7e5ae1e5ba242851f7cbecf4b964c561092f306 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 29 Jan 2016 10:31:54 -0700 Subject: [PATCH] When freeing the iobs after pty tear-down, also free the associated event structures. Quiets a memory leak warnings from address sanitizer and valgrind. --- src/exec_pty.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/exec_pty.c b/src/exec_pty.c index 8055c5603..359dde255 100644 --- a/src/exec_pty.c +++ b/src/exec_pty.c @@ -889,6 +889,10 @@ pty_close(struct command_status *cstat) /* Free I/O buffers. */ while ((iob = SLIST_FIRST(&iobufs)) != NULL) { SLIST_REMOVE_HEAD(&iobufs, entries); + if (iob->revent != NULL) + sudo_ev_free(iob->revent); + if (iob->wevent != NULL) + sudo_ev_free(iob->wevent); free(iob); } -- 2.40.0