fix memroy leak of window_icon->iconInfo at update_read_window_icon_order()

This commit is contained in:
weizhenwei 2017-06-13 17:12:20 +08:00
parent c39aecbdb4
commit d77802d5e9
2 changed files with 15 additions and 0 deletions

View File

@ -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);

View File

@ -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;