fix memory leak at update->window->window_state.windowRects/visibilityRects at update_read_window_state_order()

This commit is contained in:
weizhenwei 2017-06-13 16:27:28 +08:00
parent 5c19318ab5
commit 2f96df25fa
2 changed files with 4 additions and 0 deletions

View File

@ -2141,6 +2141,8 @@ void update_free(rdpUpdate* update)
free(update->altsec);
free(update->window->monitored_desktop.windowIds);
free(update->window->window_state.titleInfo.string);
free(update->window->window_state.windowRects);
free(update->window->window_state.visibilityRects);
free(update->window);
MessageQueue_Free(update->queue);
free(update);

View File

@ -294,6 +294,7 @@ BOOL update_read_window_state_order(wStream* s, WINDOW_ORDER_INFO* orderInfo, WI
Stream_Read_UINT16(s, windowState->numWindowRects); /* numWindowRects (2 bytes) */
free(windowState->windowRects);
size = sizeof(RECTANGLE_16) * windowState->numWindowRects;
windowState->windowRects = (RECTANGLE_16*) malloc(size);
if (!windowState->windowRects)
@ -328,6 +329,7 @@ BOOL update_read_window_state_order(wStream* s, WINDOW_ORDER_INFO* orderInfo, WI
Stream_Read_UINT16(s, windowState->numVisibilityRects); /* numVisibilityRects (2 bytes) */
free(windowState->visibilityRects);
size = sizeof(RECTANGLE_16) * windowState->numVisibilityRects;
windowState->visibilityRects = (RECTANGLE_16*) malloc(size);
if (!windowState->visibilityRects)