summaryrefslogtreecommitdiffstats
path: root/sesman/libscp_v0.c
diff options
context:
space:
mode:
authorilsimo <ilsimo>2006-10-16 15:08:08 +0000
committerilsimo <ilsimo>2006-10-16 15:08:08 +0000
commit3719200baafc8543ce5ed7be0a3096724e44ba7c (patch)
tree3f8cfd88914f820385142ed19bcef3baa1b3562f /sesman/libscp_v0.c
parent7698f5f4410395336b7a2d527ce38b026a6c4184 (diff)
downloadxrdp-proprietary-3719200baafc8543ce5ed7be0a3096724e44ba7c.tar.gz
xrdp-proprietary-3719200baafc8543ce5ed7be0a3096724e44ba7c.zip
adding missing license notes
Diffstat (limited to 'sesman/libscp_v0.c')
-rw-r--r--sesman/libscp_v0.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/sesman/libscp_v0.c b/sesman/libscp_v0.c
index 363b2550..4e8815fd 100644
--- a/sesman/libscp_v0.c
+++ b/sesman/libscp_v0.c
@@ -106,9 +106,10 @@ enum SCP_SERVER_STATES_E scp_v0s_accept(struct SCP_CONNECTION* c, struct SCP_SES
if (code == 0 || code == 10)
{
session = g_malloc(sizeof(struct SCP_SESSION),1);
- if (0 == session) return SCP_SERVER_STATE_INTERNAL_ERR;
-
- g_printf("session %x\n",session);
+ if (0 == session)
+ {
+ return SCP_SERVER_STATE_INTERNAL_ERR;
+ }
session->version=version;
@@ -124,14 +125,23 @@ enum SCP_SERVER_STATES_E scp_v0s_accept(struct SCP_CONNECTION* c, struct SCP_SES
/* reading username */
in_uint16_be(c->in_s, sz);
session->username=g_malloc(sz+1,0);
- if (0==session->username) return SCP_SERVER_STATE_INTERNAL_ERR;
+ if (0==session->username)
+ {
+ g_free(session);
+ return SCP_SERVER_STATE_INTERNAL_ERR;
+ }
session->username[sz]='\0';
in_uint8a(c->in_s, session->username, sz);
/* reading password */
in_uint16_be(c->in_s, sz);
session->password=g_malloc(sz+1,0);
- if (0==session->password) return SCP_SERVER_STATE_INTERNAL_ERR;
+ if (0==session->password)
+ {
+ g_free(session->username);
+ g_free(session);
+ return SCP_SERVER_STATE_INTERNAL_ERR;
+ }
session->password[sz]='\0';
in_uint8a(c->in_s, session->password, sz);
@@ -145,8 +155,6 @@ enum SCP_SERVER_STATES_E scp_v0s_accept(struct SCP_CONNECTION* c, struct SCP_SES
return SCP_SERVER_STATE_SEQUENCE_ERR;
}
- //reset_stream(c->in_s);
- //reset_stream(c->out_s);
(*s)=session;
return SCP_SERVER_STATE_OK;
}