diff options
author | Semun Lee <sm79.lee@samsung.com> | 2016-07-04 13:16:35 +0900 |
---|---|---|
committer | Semun Lee <sm79.lee@samsung.com> | 2016-07-04 13:16:35 +0900 |
commit | d80235315bcd8e876cb7ecfef6f345fc6b9dbcad (patch) | |
tree | eca4443b3a3ff67d8dc06abfd28753d160ff1133 | |
parent | 0d8c91b6bf1dc48314bf49345b058dd34b2c8b7b (diff) | |
download | appcore-widget-d80235315bcd8e876cb7ecfef6f345fc6b9dbcad.tar.gz appcore-widget-d80235315bcd8e876cb7ecfef6f345fc6b9dbcad.tar.bz2 appcore-widget-d80235315bcd8e876cb7ecfef6f345fc6b9dbcad.zip |
Initialize widget data structuressubmit/tizen/20160704.042542accepted/tizen/wearable/20160705.044509accepted/tizen/tv/20160705.044554accepted/tizen/mobile/20160705.044446accepted/tizen/ivi/20160705.044613accepted/tizen/common/20160706.141409
Uninitialized context->content_info causes crashes
Change-Id: I949e6c36dd754713447d32515505aa6640c2b4fb
Signed-off-by: Semun Lee <sm79.lee@samsung.com>
-rwxr-xr-x | src/widget_app.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/widget_app.c b/src/widget_app.c index 2018931..77ac4dd 100755 --- a/src/widget_app.c +++ b/src/widget_app.c @@ -380,7 +380,7 @@ static int __instance_create(widget_class_h handle, const char *id, const char * 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; @@ -1316,9 +1316,9 @@ widget_class_h _widget_class_create(widget_class_s *prev, const char *class_id, 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; } |