From 5d8d3b53c586df708a28cc3efd7b3d0135af3bbe Mon Sep 17 00:00:00 2001 From: weizhenwei Date: Fri, 23 Jun 2017 09:44:40 +0800 Subject: [PATCH] remove redundant NULL pointer check --- libfreerdp/core/update.c | 6 +----- libfreerdp/core/window.c | 7 +------ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/libfreerdp/core/update.c b/libfreerdp/core/update.c index e3064f302..5478be927 100644 --- a/libfreerdp/core/update.c +++ b/libfreerdp/core/update.c @@ -2156,11 +2156,7 @@ void update_free(rdpUpdate* update) free(update->altsec); free(update->window->monitored_desktop.windowIds); update_free_window_state(&update->window->window_state); - if (update->window->window_icon.iconInfo) - { - update_free_window_icon_info(update->window->window_icon.iconInfo); - update->window->window_icon.iconInfo = NULL; - } + update_free_window_icon_info(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 8153c0720..f1ef234c4 100644 --- a/libfreerdp/core/window.c +++ b/libfreerdp/core/window.c @@ -361,12 +361,7 @@ 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) - { - update_free_window_icon_info(window_icon->iconInfo); - window_icon->iconInfo = NULL; - } - + update_free_window_icon_info(window_icon->iconInfo); window_icon->iconInfo = (ICON_INFO*) calloc(1, sizeof(ICON_INFO)); if (!window_icon->iconInfo) return FALSE;