summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2012-01-05 00:16:57 +0000
committerDamien Miller <djm@cvs.openbsd.org>2012-01-05 00:16:57 +0000
commit78708d265bdb96331d74099eda4325fa01b0e5f9 (patch)
tree5dac60454da5e252a79549867b02ed3da644ed40 /usr.bin
parent0716e3c2df916aa6572da48423f34fd19b095f45 (diff)
memleak on error path
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/monitor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/monitor.c b/usr.bin/ssh/monitor.c
index 8ddc4258749..a46c3f38928 100644
--- a/usr.bin/ssh/monitor.c
+++ b/usr.bin/ssh/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.115 2011/06/23 23:35:42 djm Exp $ */
+/* $OpenBSD: monitor.c,v 1.116 2012/01/05 00:16:56 djm Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -415,6 +415,7 @@ monitor_read_log(struct monitor *pmonitor)
if (atomicio(read, pmonitor->m_log_recvfd,
buffer_ptr(&logmsg), buffer_len(&logmsg)) != buffer_len(&logmsg)) {
if (errno == EPIPE) {
+ buffer_free(&logmsg);
debug("%s: child log fd closed", __func__);
close(pmonitor->m_log_recvfd);
pmonitor->m_log_recvfd = -1;