From e17a56efb6750e7db8d060bd1a648a946395ef80 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Sun, 16 Oct 2016 23:40:54 -0700 Subject: Call auth_end() exactly once in scp_v0_process() As discovered by Valgrind, it wasn't called at all in case of a successful session creation, which leaked memory. --- sesman/scp_v0.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'sesman/scp_v0.c') diff --git a/sesman/scp_v0.c b/sesman/scp_v0.c index efa9080c..565dacb8 100644 --- a/sesman/scp_v0.c +++ b/sesman/scp_v0.c @@ -68,8 +68,6 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s) s->username); scp_v0s_replyauthentication(c, errorcode); } - - auth_end(data); } else if (data) { @@ -94,8 +92,6 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s) } session_reconnect(display, s->username); - auth_end(data); - /* don't set data to null here */ } else { @@ -148,7 +144,6 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s) if (display == 0) { - auth_end(data); scp_v0s_deny_connection(c); } else @@ -160,4 +155,5 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s) { scp_v0s_deny_connection(c); } + auth_end(data); } -- cgit v1.2.3