evas vg: check for OOM when calloc() 11/200011/2
authorHermet Park <hermetpark@gmail.com>
Mon, 18 Feb 2019 06:09:44 +0000 (15:09 +0900)
committerHermet Park <chuneon.park@samsung.com>
Mon, 18 Feb 2019 06:41:10 +0000 (06:41 +0000)
Change-Id: I665ba9dd1d1955071f75ce0d57827c830829996e

src/static_libs/vg_common/vg_common_svg.c

index 396c4db..9c69b14 100644 (file)
@@ -844,6 +844,11 @@ _create_node(Svg_Node *parent, Svg_Node_Type type)
 
    // default fill property
    node->style = calloc(1, sizeof(Svg_Style_Property));
+   if (!node->style)
+     {
+        free(node);
+        EINA_SAFETY_ON_NULL_RETURN_VAL(node->style, NULL);
+     }
 
    // update the default value of stroke and fill
    //https://www.w3.org/TR/SVGTiny12/painting.html#SpecifyingPaint