From: b.chrescionk Date: Wed, 29 Mar 2023 08:18:49 +0000 (+0200) Subject: edje_data: Adding null check to mem_alloc function X-Git-Tag: accepted/tizen/unified/20230421.103336~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f90f8a18e0f7dd17982a7f87770159f6f997dabf;p=platform%2Fupstream%2Fefl.git edje_data: Adding null check to mem_alloc function @tizen_only Change-Id: If4893ad47dbbb00c4cd819790e1a022d4df8b86f --- diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index d36db8f..45eb59a 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -98,10 +98,16 @@ Eet_Data_Descriptor *_edje_edd_edje_part_description_vector_pointer = NULL; Edje_Part_Description_Common *data; \ \ data = eina_mempool_malloc(_emp_##Type, size); \ - memset(data, 0, size); \ - data->clip_to_id = -1; \ - data->map.zoom.x = data->map.zoom.y = 1.0; \ - data->map.zoom.id_center = -1; \ + // TIZEN_ONLY(20230404): Add null check for data to prevent crash from calling methods on null object + if (data != NULL) \ + { \ + memset(data, 0, size); \ + data->clip_to_id = -1; \ + data->map.zoom.x = data->map.zoom.y = 1.0; \ + data->map.zoom.id_center = -1; \ + } \ + // + \ return data; \ } \ \