evas vg: get rid of memory leak.

alloc mem only if it didn't alloc'd yet.

@fix
This commit is contained in:
Hermet Park 2018-06-12 11:27:51 +09:00
parent a99f337413
commit 78d1fdd746
1 changed files with 5 additions and 1 deletions

View File

@ -164,8 +164,12 @@ _efl_canvas_vg_object_root_node_set(Eo *obj, Efl_Canvas_Vg_Object_Data *pd, Efl_
if (root_node)
{
pd->user_entry = calloc(1, sizeof(User_Vg_Entry));
if (!pd->user_entry)
pd->user_entry = malloc(sizeof(User_Vg_Entry));
pd->user_entry->w = pd->user_entry->h = 0;
pd->user_entry->root = root_node;
// set the parent so that vg canvas can render it.
efl_parent_set(pd->user_entry->root, pd->root);
}