diff --git a/libfreerdp/core/update.c b/libfreerdp/core/update.c index 84e4f8837..659531d84 100644 --- a/libfreerdp/core/update.c +++ b/libfreerdp/core/update.c @@ -2143,6 +2143,13 @@ void update_free(rdpUpdate* update) free(update->window->window_state.titleInfo.string); free(update->window->window_state.windowRects); free(update->window->window_state.visibilityRects); + if (update->window->window_icon.iconInfo) + { + free(update->window->window_icon.iconInfo->bitsColor); + free(update->window->window_icon.iconInfo->bitsMask); + free(update->window->window_icon.iconInfo->colorTable); + free(update->window->window_icon.iconInfo); + } free(update->window); MessageQueue_Free(update->queue); free(update); diff --git a/libfreerdp/core/window.c b/libfreerdp/core/window.c index 405e24b5e..c70cf6eb9 100644 --- a/libfreerdp/core/window.c +++ b/libfreerdp/core/window.c @@ -352,6 +352,14 @@ BOOL update_read_window_state_order(wStream* s, WINDOW_ORDER_INFO* orderInfo, WI BOOL update_read_window_icon_order(wStream* s, WINDOW_ORDER_INFO* orderInfo, WINDOW_ICON_ORDER* window_icon) { + if (window_icon->iconInfo) + { + free(window_icon->iconInfo->bitsColor); + free(window_icon->iconInfo->bitsMask); + free(window_icon->iconInfo->colorTable); + free(window_icon->iconInfo); + } + window_icon->iconInfo = (ICON_INFO*) calloc(1, sizeof(ICON_INFO)); if (!window_icon->iconInfo) return FALSE;