summaryrefslogtreecommitdiffstats
path: root/libxrdp
diff options
context:
space:
mode:
authorLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2014-07-19 11:56:00 -0700
committerLaxmikant Rashinkar <LK.Rashinkar@gmail.com>2014-07-19 11:56:00 -0700
commit3bb31876e797c7a13b4ffb7d67a5d710cbf4fab3 (patch)
tree8888abf5bfb3b666027746c78a7466e09fa3a557 /libxrdp
parentc64b1544752547cede30647bb03ab1bbbc06d079 (diff)
downloadxrdp-proprietary-3bb31876e797c7a13b4ffb7d67a5d710cbf4fab3.tar.gz
xrdp-proprietary-3bb31876e797c7a13b4ffb7d67a5d710cbf4fab3.zip
coverity: fixed resolution leak issues
Diffstat (limited to 'libxrdp')
-rw-r--r--libxrdp/libxrdp.c6
-rw-r--r--libxrdp/xrdp_iso.c1
-rw-r--r--libxrdp/xrdp_rdp.c4
-rw-r--r--libxrdp/xrdp_sec.c14
4 files changed, 18 insertions, 7 deletions
diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c
index e9c3508b..e5b921c0 100644
--- a/libxrdp/libxrdp.c
+++ b/libxrdp/libxrdp.c
@@ -308,15 +308,18 @@ libxrdp_send_palette(struct xrdp_session *session, int *palette)
}
DEBUG(("libxrdp_send_palette sending palette"));
+
/* clear orders */
libxrdp_orders_force_send(session);
make_stream(s);
init_stream(s, 8192);
+
if (session->client_info->use_fast_path & 1) /* fastpath output supported */
{
LLOGLN(10, ("libxrdp_send_palette: fastpath"));
if (xrdp_rdp_init_fastpath((struct xrdp_rdp *)session->rdp, s) != 0)
{
+ free_stream(s);
return 1;
}
}
@@ -345,6 +348,7 @@ libxrdp_send_palette(struct xrdp_session *session, int *palette)
if (xrdp_rdp_send_fastpath((struct xrdp_rdp *)session->rdp, s,
FASTPATH_UPDATETYPE_PALETTE) != 0)
{
+ free_stream(s);
return 1;
}
}
@@ -354,6 +358,7 @@ libxrdp_send_palette(struct xrdp_session *session, int *palette)
RDP_DATA_PDU_UPDATE);
}
free_stream(s);
+
/* send the orders palette too */
libxrdp_orders_init(session);
libxrdp_orders_send_palette(session, palette, 0);
@@ -775,6 +780,7 @@ libxrdp_set_pointer(struct xrdp_session *session, int cache_idx)
if (xrdp_rdp_send_fastpath((struct xrdp_rdp *)session->rdp, s,
FASTPATH_UPDATETYPE_CACHED) != 0)
{
+ free_stream(s);
return 1;
}
}
diff --git a/libxrdp/xrdp_iso.c b/libxrdp/xrdp_iso.c
index 633dc5a9..6fb803ad 100644
--- a/libxrdp/xrdp_iso.c
+++ b/libxrdp/xrdp_iso.c
@@ -226,6 +226,7 @@ xrdp_iso_send_cc(struct xrdp_iso *self)
if (trans_force_write_s(self->trans, s) != 0)
{
+ free_stream(s);
return 1;
}
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c
index 3719b015..2cc7c28b 100644
--- a/libxrdp/xrdp_rdp.c
+++ b/libxrdp/xrdp_rdp.c
@@ -705,7 +705,8 @@ xrdp_rdp_send_data_update_sync(struct xrdp_rdp *self)
LLOGLN(10, ("xrdp_rdp_send_data_update_sync: fastpath"));
if (xrdp_rdp_init_fastpath(self, s) != 0)
{
- return 1;
+ free_stream(s);
+ return 1;
}
}
else /* slowpath */
@@ -727,6 +728,7 @@ xrdp_rdp_send_data_update_sync(struct xrdp_rdp *self)
if (xrdp_rdp_send_fastpath(self, s,
FASTPATH_UPDATETYPE_SYNCHRONIZE) != 0)
{
+ free_stream(s);
return 1;
}
}
diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c
index d726f3e8..6ebdf715 100644
--- a/libxrdp/xrdp_sec.c
+++ b/libxrdp/xrdp_sec.c
@@ -771,7 +771,7 @@ xrdp_sec_send_media_lic_response(struct xrdp_sec *self)
/*****************************************************************************/
static void APP_CC
-xrdp_sec_rsa_op(struct xrdp_sec *self, char *out, char *in, int in_bytes,
+xrdp_sec_rsa_op(struct xrdp_sec *self, char *out, char *in, int in_bytes,
char *mod, char *exp)
{
ssl_mod_exp(out, self->rsa_key_bytes, in, in_bytes,
@@ -1616,7 +1616,6 @@ xrdp_sec_process_mcs_data_channels(struct xrdp_sec *self, struct stream *s)
{
int num_channels;
int index;
- struct mcs_channel_item *channel_item;
DEBUG(("processing channels, channel_code is %d", self->channel_code));
@@ -1641,16 +1640,19 @@ xrdp_sec_process_mcs_data_channels(struct xrdp_sec *self, struct stream *s)
for (index = 0; index < num_channels; index++)
{
+ struct mcs_channel_item *channel_item;
+
channel_item = (struct mcs_channel_item *)
g_malloc(sizeof(struct mcs_channel_item), 1);
if (!s_check_rem(s, 12))
{
+ g_free(channel_item);
return 1;
}
in_uint8a(s, channel_item->name, 8);
in_uint32_le(s, channel_item->flags);
channel_item->chanid = MCS_GLOBAL_CHANNEL + (index + 1);
- list_add_item(self->mcs_layer->channel_list, (tintptr)channel_item);
+ list_add_item(self->mcs_layer->channel_list, (tintptr) channel_item);
DEBUG(("got channel flags %8.8x name %s", channel_item->flags,
channel_item->name));
}
@@ -1852,7 +1854,7 @@ xrdp_sec_out_mcs_data(struct xrdp_sec *self)
gcc_size_ptr = s->p; /* RDPGCCUserDataResponseLength */
out_uint8s(s, 2);
ud_ptr = s->p; /* User Data */
-
+
out_uint16_le(s, SEC_TAG_SRV_INFO);
if (self->mcs_layer->iso_layer->selectedProtocol != -1)
{
@@ -1866,7 +1868,7 @@ xrdp_sec_out_mcs_data(struct xrdp_sec *self)
out_uint8(s, 0);
out_uint8(s, 8);
out_uint8(s, 0);
- if (self->mcs_layer->iso_layer->selectedProtocol != -1)
+ if (self->mcs_layer->iso_layer->selectedProtocol != -1)
{
/* ReqeustedProtocol */
out_uint32_le(s, self->mcs_layer->iso_layer->selectedProtocol);
@@ -2060,7 +2062,7 @@ xrdp_sec_incoming(struct xrdp_sec *self)
{
item = (char *)list_get_item(items, index);
value = (char *)list_get_item(values, index);
-
+
if (g_strcasecmp(item, "pub_exp") == 0)
{
hex_str_to_bin(value, self->pub_exp, 4);