]> granicus.if.org Git - sudo/commitdiff
When freeing the iobs after pty tear-down, also free the associated
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 29 Jan 2016 17:31:54 +0000 (10:31 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 29 Jan 2016 17:31:54 +0000 (10:31 -0700)
event structures.  Quiets a memory leak warnings from address
sanitizer and valgrind.

src/exec_pty.c

index 8055c5603189b3d5d3056c31d549179a0408216d..359dde255868da65a8c02e3e23cab0130a2a161b 100644 (file)
@@ -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);
     }