[PATCH] mux: fix memory leak of control path if bind() fails

Bert Wesarg bert.wesarg at googlemail.com
Fri Apr 27 19:29:56 EST 2012


---
 mux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mux.c b/mux.c
index d90605e..fa796bd 100644
--- a/mux.c
+++ b/mux.c
@@ -1195,6 +1195,7 @@ muxserver_listen(void)
 				close(muxserver_sock);
 				muxserver_sock = -1;
 			}
+			xfree(orig_control_path);
 			xfree(options.control_path);
 			options.control_path = NULL;
 			options.control_master = SSHCTL_MASTER_NO;
@@ -1216,7 +1217,6 @@ muxserver_listen(void)
 		}
 		error("ControlSocket %s already exists, disabling multiplexing",
 		    orig_control_path);
-		xfree(orig_control_path);
 		unlink(options.control_path);
 		goto disable_mux_master;
 	}
-- 
1.7.9.rc0.542.g07ca1



More information about the openssh-unix-dev mailing list