evas vg: check for OOM when calloc()

This commit is contained in:
Hermet Park 2019-02-18 15:09:44 +09:00
parent a921040743
commit 0a47a0ef32
1 changed files with 5 additions and 0 deletions

View 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