lParam = (WINDOW_ICON_ORDER*) calloc(1, sizeof(WINDOW_ICON_ORDER));
if (!lParam)
- {
- free(wParam);
- return FALSE;
- }
+ goto out_fail;
+
+ lParam->iconInfo = calloc(1, sizeof(ICON_INFO));
+ if (!lParam->iconInfo)
+ goto out_fail;
CopyMemory(lParam, windowIcon, sizeof(WINDOW_ICON_ORDER));
WLog_VRB(TAG, "update_message_WindowIcon");
return MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(WindowUpdate, WindowIcon), (void*) wParam, (void*) lParam);
out_fail:
- free(lParam->iconInfo->bitsColor);
- free(lParam->iconInfo->bitsMask);
- free(lParam->iconInfo->colorTable);
- free(lParam);
+ if (lParam && lParam->iconInfo)
+ {
+ free(lParam->iconInfo->bitsColor);
+ free(lParam->iconInfo->bitsMask);
+ free(lParam->iconInfo->colorTable);
+ free(lParam->iconInfo);
+ }
+
+ free(lParam);
free(wParam);
return FALSE;
}
}
free(orderInfo);
+ free(windowIcon->iconInfo);
free(windowIcon);
}
break;