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.
This commit is contained in:
parent
65ac8e758b
commit
e17a56efb6
@ -68,8 +68,6 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
|
|||||||
s->username);
|
s->username);
|
||||||
scp_v0s_replyauthentication(c, errorcode);
|
scp_v0s_replyauthentication(c, errorcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
auth_end(data);
|
|
||||||
}
|
}
|
||||||
else if (data)
|
else if (data)
|
||||||
{
|
{
|
||||||
@ -94,8 +92,6 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
session_reconnect(display, s->username);
|
session_reconnect(display, s->username);
|
||||||
auth_end(data);
|
|
||||||
/* don't set data to null here */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -148,7 +144,6 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
|
|||||||
|
|
||||||
if (display == 0)
|
if (display == 0)
|
||||||
{
|
{
|
||||||
auth_end(data);
|
|
||||||
scp_v0s_deny_connection(c);
|
scp_v0s_deny_connection(c);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -160,4 +155,5 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
|
|||||||
{
|
{
|
||||||
scp_v0s_deny_connection(c);
|
scp_v0s_deny_connection(c);
|
||||||
}
|
}
|
||||||
|
auth_end(data);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user