examples/camera_light: free resources if we fail to allocate all and leave

We return here leaving maybe some other allocations around and leaking.

CID: 1327348, 1327349, 1327350
This commit is contained in:
Stefan Schmidt 2015-10-20 16:16:31 +02:00
parent f9defcd945
commit 998d007558
1 changed files with 3 additions and 0 deletions

View File

@ -9,6 +9,9 @@ Eina_Bool _alloc_memory(Axis_Key **ckey, Panel_Struct **pobj, Axis_Key **lkey)
if (!(*ckey) || !(*pobj) || !(*lkey))
{
fprintf(stdout, "Not enough memory - at %s line %d\n", __FILE__, __LINE__);
free(*ckey);
free(*pobj);
free(*lkey);
return EINA_FALSE;
}