]> granicus.if.org Git - sudo/commitdiff
Fix memory leak of I/O buffer events in safe_close().
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 18 Oct 2013 22:28:49 +0000 (16:28 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 18 Oct 2013 22:28:49 +0000 (16:28 -0600)
src/exec_pty.c

index fd5ffa175b2382717f73a2172ef5f7e82e8ee925..f6fd62378cbc5675d0d441789e8eae4044622515 100644 (file)
@@ -1491,6 +1491,7 @@ safe_close(int fd)
                    "%s: deleting revent %p due to shared fd %d",
                    __func__, iob->revent, fd);
                sudo_ev_del(NULL, iob->revent);
+               sudo_ev_free(iob->revent);
            }
        }
        if (iob->wevent != NULL) {
@@ -1499,6 +1500,7 @@ safe_close(int fd)
                    "%s: deleting wevent %p due to shared fd %d",
                    __func__, iob->wevent, fd);
                sudo_ev_del(NULL, iob->wevent);
+               sudo_ev_free(iob->wevent);
            }
        }
     }