GUACAMOLE-249: Free rdpBitmap and rdpGlyph within custom free handlers (not automatically freed like rdpPointer).

This commit is contained in:
Michael Jumper 2019-12-30 16:11:13 -08:00
parent 0926864ecb
commit 8dda26af54
3 changed files with 17 additions and 0 deletions

View File

@ -156,6 +156,13 @@ void guac_rdp_bitmap_free(rdpContext* context, rdpBitmap* bitmap) {
if (buffer != NULL) if (buffer != NULL)
guac_common_display_free_buffer(rdp_client->display, buffer); guac_common_display_free_buffer(rdp_client->display, buffer);
/* NOTE: FreeRDP-allocated memory for the rdpBitmap will NOT be
* automatically released after this free handler is invoked, thus we must
* do so manually here */
_aligned_free(bitmap->data);
free(bitmap);
} }
BOOL guac_rdp_bitmap_setsurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary) { BOOL guac_rdp_bitmap_setsurface(rdpContext* context, rdpBitmap* bitmap, BOOL primary) {

View File

@ -121,6 +121,13 @@ void guac_rdp_glyph_free(rdpContext* context, rdpGlyph* glyph) {
cairo_surface_destroy(((guac_rdp_glyph*) glyph)->surface); cairo_surface_destroy(((guac_rdp_glyph*) glyph)->surface);
free(image_buffer); free(image_buffer);
/* NOTE: FreeRDP-allocated memory for the rdpGlyph will NOT be
* automatically released after this free handler is invoked, thus we must
* do so manually here */
free(glyph->aj);
free(glyph);
} }
BOOL guac_rdp_glyph_begindraw(rdpContext* context, INT32 x, INT32 y, BOOL guac_rdp_glyph_begindraw(rdpContext* context, INT32 x, INT32 y,

View File

@ -95,6 +95,9 @@ void guac_rdp_pointer_free(rdpContext* context, rdpPointer* pointer) {
/* Free buffer */ /* Free buffer */
guac_common_display_free_buffer(rdp_client->display, buffer); guac_common_display_free_buffer(rdp_client->display, buffer);
/* NOTE: FreeRDP-allocated memory for the rdpPointer will be automatically
* released after this free handler is invoked */
} }
BOOL guac_rdp_pointer_set_null(rdpContext* context) { BOOL guac_rdp_pointer_set_null(rdpContext* context) {