efl_ui_widget: Add exception handling for calloc
authorMyoungwoon Roy, Kim <myoungwoon.kim@samsung.com>
Wed, 1 Jul 2020 00:07:41 +0000 (09:07 +0900)
committerJongmin Lee <jm105.lee@samsung.com>
Sun, 5 Jul 2020 21:55:16 +0000 (06:55 +0900)
Change-Id: I5c897e3a98fe73289e6eb4adc08462c8c6eeab66

src/lib/elementary/efl_ui_widget.c

index 18902d5..564c262 100644 (file)
@@ -9023,6 +9023,7 @@ _elm_widget_color_class_set_internal(Evas_Object *obj, Evas_Object *edje, const
         if (!cc)
           {
              cc = calloc(1, sizeof(Edje_Color_Class));
+             if (!cc) goto on_error;
              cc->name = eina_stringshare_add(buf);
              eina_hash_direct_add(sd->color_classes, cc->name, cc);
           }
@@ -9032,6 +9033,7 @@ _elm_widget_color_class_set_internal(Evas_Object *obj, Evas_Object *edje, const
      }
    //
 
+on_error:
    eina_stringshare_del(buf);
 
    return int_ret;