From c2a33f2225a8f0f32acaa23e68446658ddce000a Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sat, 10 Aug 2019 23:04:29 +0100 Subject: [PATCH] efl filter model - fix return value handling to avoid uninit mem access coverity reported - it's right. this fixes CID 1401461 and CID 1401463 --- src/lib/ecore/efl_filter_model.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore/efl_filter_model.c b/src/lib/ecore/efl_filter_model.c index 8a00d82141..7626f5dbbb 100644 --- a/src/lib/ecore/efl_filter_model.c +++ b/src/lib/ecore/efl_filter_model.c @@ -362,7 +362,7 @@ _efl_filter_model_efl_model_children_slice_get(Eo *obj, Efl_Filter_Model_Data *p if (count == 0) return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE); - r = malloc((count + 1) * sizeof (Eina_Future *)); + r = calloc(1, (count + 1) * sizeof (Eina_Future *)); if (!r) return efl_loop_future_rejected(obj, ENOMEM); mapping = calloc(count, sizeof (Efl_Filter_Model_Mapping *)); @@ -385,7 +385,7 @@ _efl_filter_model_efl_model_children_slice_get(Eo *obj, Efl_Filter_Model_Data *p r[i] = efl_future_then(obj, r[i], .success_type = EINA_VALUE_TYPE_ARRAY, .success = _filter_remove_array, .data = mapping[i]); - if (!r) goto on_error; + if (!r[i]) goto on_error; } r[i] = EINA_FUTURE_SENTINEL;