Skip to content

Commit

Permalink
fix memroy leak of window_icon->iconInfo at update_read_window_icon_o…
Browse files Browse the repository at this point in the history
…rder()
  • Loading branch information
weizhenwei committed Jun 21, 2017
1 parent c39aecb commit d77802d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libfreerdp/core/update.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 8 additions & 0 deletions libfreerdp/core/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d77802d

Please sign in to comment.