summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/mux.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2013-06-05 02:07:30 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2013-06-05 02:07:30 +0000
commit69d45c9634312598b247320e7af351d0e396664f (patch)
treef28e6a6f42fc9fdb0defaa3569881cf576237328 /usr.bin/ssh/mux.c
parent0e570d0a818450b6ba62c467497287e7ad628d19 (diff)
fix leaks in mux error paths, from Zhenbo Xu, found by Melton. bz#1967, ok djm
Diffstat (limited to 'usr.bin/ssh/mux.c')
-rw-r--r--usr.bin/ssh/mux.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/ssh/mux.c b/usr.bin/ssh/mux.c
index bcaa4fdd790..4d62b72790e 100644
--- a/usr.bin/ssh/mux.c
+++ b/usr.bin/ssh/mux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mux.c,v 1.42 2013/06/02 23:36:29 dtucker Exp $ */
+/* $OpenBSD: mux.c,v 1.43 2013/06/05 02:07:29 dtucker Exp $ */
/*
* Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
*
@@ -275,6 +275,7 @@ process_mux_master_hello(u_int rid, Channel *c, Buffer *m, Buffer *r)
if (name == NULL || value == NULL) {
free(name);
+ free(value);
goto malf;
}
debug2("Unrecognised slave extension \"%s\"", name);
@@ -1407,7 +1408,9 @@ mux_client_read_packet(int fd, Buffer *m)
buffer_init(&queue);
if (mux_client_read(fd, &queue, 4) != 0) {
if ((oerrno = errno) == EPIPE)
- debug3("%s: read header failed: %s", __func__, strerror(errno));
+ debug3("%s: read header failed: %s", __func__,
+ strerror(errno));
+ buffer_free(&queue);
errno = oerrno;
return -1;
}
@@ -1415,6 +1418,7 @@ mux_client_read_packet(int fd, Buffer *m)
if (mux_client_read(fd, &queue, need) != 0) {
oerrno = errno;
debug3("%s: read body failed: %s", __func__, strerror(errno));
+ buffer_free(&queue);
errno = oerrno;
return -1;
}