Fix memory leak 01/122601/1 submit/tizen/20170404.075729
authorInkyun Kil <inkyun.kil@samsung.com>
Mon, 3 Apr 2017 04:30:31 +0000 (13:30 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Mon, 3 Apr 2017 04:31:29 +0000 (13:31 +0900)
Change-Id: If280dd2155b75cabc42f7a2d4a8544b8707dfb65
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
src/esd_main.c

index 93e096a..cb00e9e 100644 (file)
@@ -1010,18 +1010,21 @@ static int __esd_get_user_items(void)
                                        PMINFO_APPINFO_PROP_APP_COMPONENT, "svcapp");
                        if (ret < 0) {
                                _E("failed to add appinfo filter string");
+                               pkgmgrinfo_appinfo_filter_destroy(handle);
                                return ES_R_ERROR;
                        }
                        ret = pkgmgrinfo_appinfo_filter_add_string(handle,
                                        PMINFO_APPINFO_PROP_APP_OPERATION, APPSVC_OPERATION_LAUNCH_ON_EVENT);
                        if (ret < 0) {
                                _E("failed to add appinfo filter string");
+                               pkgmgrinfo_appinfo_filter_destroy(handle);
                                return ES_R_ERROR;
                        }
                        ret = pkgmgrinfo_appinfo_usr_filter_foreach_appinfo(handle,
                                        __esd_add_appinfo_handler, &cur_uid, cur_uid);
                        if (ret < 0) {
                                _E("appinfo filter foreach error");
+                               pkgmgrinfo_appinfo_filter_destroy(handle);
                                return ES_R_ERROR;
                        }
                        pkgmgrinfo_appinfo_filter_destroy(handle);