summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2012-02-11 08:16:06 +1100
committerDamien Miller <djm@mindrot.org>2012-02-11 08:16:06 +1100
commita2876db5e6a26c48bd2a20a9f347a1e668730845 (patch)
treec1cb47f55ba950bd95abac8fb9d6dcef9be93749 /monitor.c
parentb56e4930aeada1b73d3457b452bf241236fdb1ed (diff)
downloadopenssh-git-a2876db5e6a26c48bd2a20a9f347a1e668730845.tar.gz
- djm@cvs.openbsd.org 2012/01/05 00:16:56
[monitor.c] memleak on error path
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/monitor.c b/monitor.c
index a166fed2..e7abf249 100644
--- a/monitor.c
+++ b/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>
@@ -507,6 +507,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;