remove useless NULL pointer check before free

This commit is contained in:
weizhenwei 2017-06-23 09:21:16 +08:00
parent 61b24bf0b3
commit 3b52a60d31
4 changed files with 21 additions and 46 deletions

View File

@ -869,7 +869,6 @@ out_error:
MessageQueue_Free(drive->IrpQueue);
ListDictionary_Free(drive->files);
drive_free(drive);
free(drive);
return error;
}

View File

@ -100,23 +100,14 @@ static void rail_client_clean_exec_order(RAIL_EXEC_ORDER* exec)
if (!exec)
return;
if (exec->exeOrFile.string)
{
free(exec->exeOrFile.string);
exec->exeOrFile.string = NULL;
}
if (exec->workingDir.string)
{
free(exec->workingDir.string);
exec->workingDir.string = NULL;
}
if (exec->arguments.string)
{
free(exec->arguments.string);
exec->arguments.string = NULL;
}
}
/**

View File

@ -2046,23 +2046,14 @@ static void update_free_window_state(WINDOW_STATE_ORDER* window_state)
if (!window_state)
return;
if (window_state->titleInfo.string)
{
free(window_state->titleInfo.string);
window_state->titleInfo.string = NULL;
}
if (window_state->windowRects)
{
free(window_state->windowRects);
window_state->windowRects = NULL;
}
if (window_state->visibilityRects)
{
free(window_state->visibilityRects);
window_state->visibilityRects = NULL;
}
}
rdpUpdate* update_new(rdpRdp* rdp)

View File

@ -600,23 +600,17 @@ BOOL update_recv_desktop_info_order(rdpUpdate* update, wStream* s, WINDOW_ORDER_
void update_free_window_icon_info(ICON_INFO* iconInfo)
{
if (iconInfo->bitsColor)
{
if (!iconInfo)
return;
free(iconInfo->bitsColor);
iconInfo->bitsColor = NULL;
}
if (iconInfo->bitsMask)
{
free(iconInfo->bitsMask);
iconInfo->bitsMask = NULL;
}
if (iconInfo->colorTable)
{
free(iconInfo->colorTable);
iconInfo->colorTable = NULL;
}
free(iconInfo);
}