summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2012-01-05 00:16:56 +0000
committerdjm <djm@openbsd.org>2012-01-05 00:16:56 +0000
commit148c40fb5d3b080fc6891566fa113de9c5f99b3a (patch)
tree0b01a88096ea49cb68d8b82a94c77bbf05ed6f7f
parentFix $OpenBSD tag (diff)
downloadwireguard-openbsd-148c40fb5d3b080fc6891566fa113de9c5f99b3a.tar.xz
wireguard-openbsd-148c40fb5d3b080fc6891566fa113de9c5f99b3a.zip
memleak on error path
-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;