summaryrefslogtreecommitdiff
path: root/mux.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2012-02-11 08:16:28 +1100
committerDamien Miller <djm@mindrot.org>2012-02-11 08:16:28 +1100
commit2ec0342ed4f1fcf4d7b140f9d91bc97c8025221a (patch)
treef92da16e93c9388f4f5777fc22bbd1349ff1f1d3 /mux.c
parenta2876db5e6a26c48bd2a20a9f347a1e668730845 (diff)
- djm@cvs.openbsd.org 2012/01/07 21:11:36
[mux.c] fix double-free in new session handler
Diffstat (limited to 'mux.c')
-rw-r--r--mux.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mux.c b/mux.c
index 0b7abda03..d90605eb4 100644
--- a/mux.c
+++ b/mux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mux.c,v 1.33 2011/12/04 23:16:12 djm Exp $ */ 1/* $OpenBSD: mux.c,v 1.34 2012/01/07 21:11:36 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -341,10 +341,8 @@ process_mux_new_session(u_int rid, Channel *c, Buffer *m, Buffer *r)
341 env_len = 0; 341 env_len = 0;
342 while (buffer_len(m) > 0) { 342 while (buffer_len(m) > 0) {
343#define MUX_MAX_ENV_VARS 4096 343#define MUX_MAX_ENV_VARS 4096
344 if ((cp = buffer_get_string_ret(m, &len)) == NULL) { 344 if ((cp = buffer_get_string_ret(m, &len)) == NULL)
345 xfree(cmd);
346 goto malf; 345 goto malf;
347 }
348 if (!env_permitted(cp)) { 346 if (!env_permitted(cp)) {
349 xfree(cp); 347 xfree(cp);
350 continue; 348 continue;