summaryrefslogtreecommitdiffstats
path: root/sesman/libscp
diff options
context:
space:
mode:
authorPavel Roskin <plroskin@gmail.com>2016-10-16 23:40:47 -0700
committerPavel Roskin <plroskin@gmail.com>2016-10-21 20:15:50 +0000
commit65ac8e758b6bd1458c8228613db4fec99d54d86f (patch)
tree49336ba19adf42784764d85c0e9f0d1037f1ed85 /sesman/libscp
parent8bf28e45c4ff59f3195966a107611b211ee5aca3 (diff)
downloadxrdp-proprietary-65ac8e758b6bd1458c8228613db4fec99d54d86f.tar.gz
xrdp-proprietary-65ac8e758b6bd1458c8228613db4fec99d54d86f.zip
Fix memory leak: free session data
Call scp_session_destroy() in the functions that call scp_session_create() and nowhere else. As found by Valgrind, the session data is not freed if the session is created successfully.
Diffstat (limited to 'sesman/libscp')
-rw-r--r--sesman/libscp/libscp_v1s.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/sesman/libscp/libscp_v1s.c b/sesman/libscp/libscp_v1s.c
index 284c9b52..a03fea38 100644
--- a/sesman/libscp/libscp_v1s.c
+++ b/sesman/libscp/libscp_v1s.c
@@ -330,7 +330,6 @@ scp_v1s_request_password(struct SCP_CONNECTION *c, struct SCP_SESSION *s,
if (0 != scp_session_set_username(s, buf))
{
- scp_session_destroy(s);
log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: internal error", __LINE__);
return SCP_SERVER_STATE_INTERNAL_ERR;
}
@@ -342,7 +341,6 @@ scp_v1s_request_password(struct SCP_CONNECTION *c, struct SCP_SESSION *s,
if (0 != scp_session_set_password(s, buf))
{
- scp_session_destroy(s);
log_message(LOG_LEVEL_WARNING, "[v1s:%d] connection aborted: internal error", __LINE__);
return SCP_SERVER_STATE_INTERNAL_ERR;
}