eina_inline: Fixed a potential dangling pointer

Summary: fixed by null handling

Test Plan: N/A

Reviewers: Hermet, YOhoho, cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10850
This commit is contained in:
junsu choi 2019-12-11 09:27:10 +09:00
parent 271b56889f
commit ab67611c65
1 changed files with 5 additions and 1 deletions

View File

@ -150,7 +150,11 @@ eina_value_flush(Eina_Value *value)
}
else if (type == EINA_VALUE_TYPE_STRING)
{
if (value->value.ptr) free(value->value.ptr);
if (value->value.ptr)
{
free(value->value.ptr);
value->value.ptr = NULL;
}
}
else if (type->value_size > 8)
eina_value_inner_free(type->value_size, mem);