examples/camera_light: free resources if we fail to allocate all and leave
authorStefan Schmidt <stefan@osg.samsung.com>
Tue, 20 Oct 2015 14:16:31 +0000 (16:16 +0200)
committerStefan Schmidt <stefan@osg.samsung.com>
Tue, 20 Oct 2015 14:16:31 +0000 (16:16 +0200)
We return here leaving maybe some other allocations around and leaking.

CID: 132734813273491327350

src/examples/performance/camera_light.c

index 7b006f39b57f447c68f1678212b14bf7bcf9d18d..2d4a28c31996ec1262312d6644193d40b96cc20a 100644 (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;
      }