PATCH: Fix memory leak in sshd

Zev Weiss zevweiss at gmail.com
Sat Jan 28 20:30:34 EST 2012


Hello,

The below patch fixes a memory leak I noticed in monitor_read_load() when the child's log pipe is closed.

Thanks,
Zev Weiss
--

diff --git a/monitor.c b/monitor.c
index a166fed..6464eec 100644
--- a/monitor.c
+++ b/monitor.c
@@ -510,6 +510,7 @@ monitor_read_log(struct monitor *pmonitor)
 			debug("%s: child log fd closed", __func__);
 			close(pmonitor->m_log_recvfd);
 			pmonitor->m_log_recvfd = -1;
+			buffer_free(&logmsg);
 			return -1;
 		}
 		fatal("%s: log fd read: %s", __func__, strerror(errno));




More information about the openssh-unix-dev mailing list