From: Hwankyu Jhun Date: Tue, 1 Aug 2017 22:49:28 +0000 (+0900) Subject: Add an exception handling about out of memory X-Git-Tag: accepted/tizen/4.0/unified/20170816.013859~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=235900c76c8274ea24f2f7a32a9a702c1c941710;p=platform%2Fcore%2Fappfw%2Fscreen-connector.git Add an exception handling about out of memory Change-Id: I9838c04a7808675b1f46ca98bdc1b1fee29a5611 Signed-off-by: Hwankyu Jhun --- diff --git a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c index 74781a1..fce15d4 100644 --- a/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c +++ b/screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c @@ -758,9 +758,13 @@ static void __toolkit_update_cb(struct tizen_remote_surface *trs, uint32_t type, c_buf_info = g_hash_table_lookup(__cur_buffer_table, toolkit_evas_h->cur_buffer); if (c_buf_info == NULL) { c_buf_info = (cur_buffer_info_h)calloc(1, sizeof(struct _cur_buffer_info_h)); - c_buf_info->cur_buffer = toolkit_evas_h->cur_buffer; - __cur_buffer_info_ref(c_buf_info); - g_hash_table_insert(__cur_buffer_table, toolkit_evas_h->cur_buffer, c_buf_info); + if (c_buf_info == NULL) { + LOGE("Out of memory"); + } else { + c_buf_info->cur_buffer = toolkit_evas_h->cur_buffer; + __cur_buffer_info_ref(c_buf_info); + g_hash_table_insert(__cur_buffer_table, toolkit_evas_h->cur_buffer, c_buf_info); + } } else { __cur_buffer_info_ref(c_buf_info); }