Minor memory leaks found with valgrind
This commit is contained in:
@@ -1107,6 +1107,7 @@ vnc_clip_open_clip_channel(struct vnc *v)
|
|||||||
s_mark_end(s);
|
s_mark_end(s);
|
||||||
send_stream_to_clip_channel(v, s);
|
send_stream_to_clip_channel(v, s);
|
||||||
|
|
||||||
|
free_stream(s);
|
||||||
/* Need to complete the startup handshake before we send formats */
|
/* Need to complete the startup handshake before we send formats */
|
||||||
v->vc->startup_complete = 1;
|
v->vc->startup_complete = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-22
@@ -120,8 +120,8 @@ xrdp_cache_create(struct xrdp_wm *owner,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void
|
static void
|
||||||
xrdp_cache_delete(struct xrdp_cache *self)
|
clear_all_cached_items(struct xrdp_cache *self)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
@@ -165,7 +165,13 @@ xrdp_cache_delete(struct xrdp_cache *self)
|
|||||||
list16_deinit(&(self->crc16[i][j]));
|
list16_deinit(&(self->crc16[i][j]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void
|
||||||
|
xrdp_cache_delete(struct xrdp_cache *self)
|
||||||
|
{
|
||||||
|
clear_all_cached_items(self);
|
||||||
g_free(self);
|
g_free(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,30 +182,12 @@ xrdp_cache_reset(struct xrdp_cache *self,
|
|||||||
{
|
{
|
||||||
struct xrdp_wm *wm;
|
struct xrdp_wm *wm;
|
||||||
struct xrdp_session *session;
|
struct xrdp_session *session;
|
||||||
int i;
|
|
||||||
int j;
|
|
||||||
|
|
||||||
/* free all the cached bitmaps */
|
|
||||||
for (i = 0; i < XRDP_MAX_BITMAP_CACHE_ID; i++)
|
|
||||||
{
|
|
||||||
for (j = 0; j < XRDP_MAX_BITMAP_CACHE_IDX; j++)
|
|
||||||
{
|
|
||||||
xrdp_bitmap_delete(self->bitmap_items[i][j].bitmap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* free all the cached font items */
|
|
||||||
for (i = 0; i < 12; i++)
|
|
||||||
{
|
|
||||||
for (j = 0; j < 256; j++)
|
|
||||||
{
|
|
||||||
g_free(self->char_items[i][j].font_item.data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* save these */
|
/* save these */
|
||||||
wm = self->wm;
|
wm = self->wm;
|
||||||
session = self->session;
|
session = self->session;
|
||||||
|
/* De-allocate any allocated memory */
|
||||||
|
clear_all_cached_items(self);
|
||||||
/* set whole struct to zero */
|
/* set whole struct to zero */
|
||||||
g_memset(self, 0, sizeof(struct xrdp_cache));
|
g_memset(self, 0, sizeof(struct xrdp_cache));
|
||||||
/* set some stuff back */
|
/* set some stuff back */
|
||||||
|
|||||||
Reference in New Issue
Block a user