summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoichiro IWAO <meta@vmeta.jp>2018-01-17 16:13:22 +0900
committerKoichiro IWAO <meta@vmeta.jp>2018-01-23 11:16:26 +0900
commite16029cbc251fd37ab1b601ea12e9e12efed4e60 (patch)
tree858c78ab87d6cd88f837428adc41176181ba55bb
parentf763cb37885b02c310aa906147669a29b99405dc (diff)
downloadxrdp-proprietary-e16029cbc251fd37ab1b601ea12e9e12efed4e60.tar.gz
xrdp-proprietary-e16029cbc251fd37ab1b601ea12e9e12efed4e60.zip
fix leak of SCP_DISCONNECTED_SESSION
Pointed out by: #919
-rw-r--r--sesman/libscp/libscp_v1c.c6
-rw-r--r--sesman/libscp/libscp_v1c_mng.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/sesman/libscp/libscp_v1c.c b/sesman/libscp/libscp_v1c.c
index 5401dda3..dfc3754d 100644
--- a/sesman/libscp/libscp_v1c.c
+++ b/sesman/libscp/libscp_v1c.c
@@ -177,6 +177,7 @@ scp_v1c_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8))
{
+ g_free(ds);
return SCP_CLIENT_STATE_NETWORK_ERR;
}
@@ -184,6 +185,7 @@ scp_v1c_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (version != 1)
{
+ g_free(ds);
return SCP_CLIENT_STATE_VERSION_ERR;
}
@@ -191,6 +193,7 @@ scp_v1c_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (size < 12)
{
+ g_free(ds);
return SCP_CLIENT_STATE_SIZE_ERR;
}
@@ -198,6 +201,7 @@ scp_v1c_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8))
{
+ g_free(ds);
return SCP_CLIENT_STATE_NETWORK_ERR;
}
@@ -205,6 +209,7 @@ scp_v1c_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (cmd != SCP_COMMAND_SET_DEFAULT)
{
+ g_free(ds);
return SCP_CLIENT_STATE_SEQUENCE_ERR;
}
@@ -212,6 +217,7 @@ scp_v1c_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (cmd != 42)
{
+ g_free(ds);
return SCP_CLIENT_STATE_SEQUENCE_ERR;
}
diff --git a/sesman/libscp/libscp_v1c_mng.c b/sesman/libscp/libscp_v1c_mng.c
index 2ceaa95e..f1eb7cf6 100644
--- a/sesman/libscp/libscp_v1c_mng.c
+++ b/sesman/libscp/libscp_v1c_mng.c
@@ -144,6 +144,7 @@ scp_v1c_mng_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8))
{
log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: network error", __LINE__);
+ g_free(ds);
return SCP_CLIENT_STATE_NETWORK_ERR;
}
@@ -152,6 +153,7 @@ scp_v1c_mng_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (version != 1)
{
log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: version error", __LINE__);
+ g_free(ds);
return SCP_CLIENT_STATE_VERSION_ERR;
}
@@ -160,6 +162,7 @@ scp_v1c_mng_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (size < 12)
{
log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: size error", __LINE__);
+ g_free(ds);
return SCP_CLIENT_STATE_SIZE_ERR;
}
@@ -168,6 +171,7 @@ scp_v1c_mng_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8))
{
log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: network error", __LINE__);
+ g_free(ds);
return SCP_CLIENT_STATE_NETWORK_ERR;
}
@@ -176,6 +180,7 @@ scp_v1c_mng_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (cmd != SCP_COMMAND_SET_MANAGE)
{
log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: sequence error", __LINE__);
+ g_free(ds);
return SCP_CLIENT_STATE_SEQUENCE_ERR;
}
@@ -184,6 +189,7 @@ scp_v1c_mng_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (cmd != SCP_CMD_MNG_LIST) /* session list */
{
log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: sequence error", __LINE__);
+ g_free(ds);
return SCP_CLIENT_STATE_SEQUENCE_ERR;
}