examples: fix memory leak. 09/56009/2 accepted/tizen/mobile/20151231.073922 accepted/tizen/tv/20151231.073936 accepted/tizen/wearable/20151231.073953 submit/tizen/20151231.050757
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 31 Dec 2015 04:58:13 +0000 (13:58 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Thu, 31 Dec 2015 05:02:51 +0000 (14:02 +0900)
Change-Id: Ifda1df85a9b184748c4d09ccd778b0194f09bdd7

src/examples/pepper_efl_simple.c

index a4b54b986a476270f68507c002c2d7ab1d9dd32c..e7d20bf1514ed3a292ea9da68a0e43e60401ad1e 100644 (file)
@@ -74,7 +74,8 @@ elm_main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
    /* pepper_efl init */
    comp_name = pepper_efl_compositor_create(win, "pepper-efl");
    if (!comp_name)
-     return ret;
+     goto err;
+
    fprintf(stderr, "display name:%s\n", comp_name);
 
    evas_object_smart_callback_add(win, PEPPER_EFL_OBJ_ADD, _add_object_cb, d);
@@ -83,6 +84,11 @@ elm_main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED)
    elm_run();
 
    pepper_efl_compositor_destroy(comp_name);
+
+   ret = EXIT_SUCCESS;
+
+err:
+   free(d);
    return ret;
 }
 ELM_MAIN()