eo: Fix resource leak

Coverity CID1339783 says that we have a potential resource leak here.
'cb' gets allocated via calloc, but is not freed if we end up
returning here

@fix

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This commit is contained in:
Chris Michael 2015-12-28 10:09:36 -05:00
parent 936350d37f
commit c94289d0b2
1 changed files with 1 additions and 0 deletions

View File

@ -564,6 +564,7 @@ _eo_base_event_callback_priority_add(Eo *obj, Eo_Base_Data *pd,
if (!cb || !desc || !func)
{
ERR("Tried adding callback with invalid values: cb: %p desc: %p func: %p\n", cb, desc, func);
free(cb);
return;
}
cb->items.item.desc = desc;