From 424738ccb9d1514de15de8616b6d32cd75b1c758 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Mon, 18 Feb 2019 15:09:44 +0900 Subject: [PATCH] evas vg: check for OOM when calloc() Change-Id: I665ba9dd1d1955071f75ce0d57827c830829996e --- src/static_libs/vg_common/vg_common_svg.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index 396c4db..9c69b14 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -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 -- 2.7.4