Uninitialized context->content_info causes crashes
Change-Id: I949e6c36dd754713447d32515505aa6640c2b4fb
Signed-off-by: Semun Lee <sm79.lee@samsung.com>
int ret = 0;
bundle *content_info = NULL;
- wc = (widget_context_s *)malloc(sizeof(widget_context_s));
+ wc = (widget_context_s *)calloc(1, sizeof(widget_context_s));
if (!wc)
return WIDGET_ERROR_OUT_OF_MEMORY;
return NULL;
}
- wc = (widget_class_s *)malloc(sizeof(widget_class_s));
+ wc = (widget_class_s *)calloc(1, sizeof(widget_class_s));
if (wc == NULL) {
- _E("failed to malloc : %s", __FUNCTION__);
+ _E("failed to calloc : %s", __FUNCTION__);
set_last_result(WIDGET_ERROR_OUT_OF_MEMORY);
return NULL;
}