From: hyunuktak Date: Mon, 3 Sep 2018 05:01:06 +0000 (+0900) Subject: Fix a bug for using heap after free X-Git-Tag: accepted/tizen/unified/20180906.054612~1^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fconnectivity%2Fstc-manager.git;a=commitdiff_plain;h=c8f94ac3feda779ad5ae0cdc47ebee417db6d643 Fix a bug for using heap after free Change-Id: I7bb7fa02324f919bd7d6aee99a2ceb0f8090a4bc Signed-off-by: hyunuktak --- diff --git a/packaging/stc-manager.spec b/packaging/stc-manager.spec index b57a246..d84c351 100644 --- a/packaging/stc-manager.spec +++ b/packaging/stc-manager.spec @@ -1,6 +1,6 @@ Name: stc-manager Summary: STC(Smart Traffic Control) manager -Version: 0.0.75 +Version: 0.0.76 Release: 0 Group: Network & Connectivity/Other License: Apache-2.0 diff --git a/src/stc-manager.c b/src/stc-manager.c old mode 100644 new mode 100755 index 58f6531..7b4876a --- a/src/stc-manager.c +++ b/src/stc-manager.c @@ -120,7 +120,11 @@ static stc_s *__stc_manager_init(void) cgroup_set_release_agent(NET_CLS_SUBSYS, NET_RELEASE_AGENT); - EXEC(STC_ERROR_NONE, stc_db_initialize()); + err = stc_db_initialize(); + if (err != STC_ERROR_NONE) { + STC_LOGD("Failed to initialize stc db"); //LCOV_EXCL_LINE + return NULL; //LCOV_EXCL_LINE + } stc_plugin_appstatus_init(); stc_plugin_exception_init(); @@ -130,8 +134,10 @@ static stc_s *__stc_manager_init(void) stc_firewall_init(); err = stc_monitor_init(); - if (err != STC_ERROR_NONE) - goto handle_error; + if (err != STC_ERROR_NONE) { + STC_LOGD("Failed to initialize stc manager"); //LCOV_EXCL_LINE + return NULL; //LCOV_EXCL_LINE + } stc_plugin_procfs_load_pid(); stc_manager_gdbus_init((gpointer)stc); @@ -139,11 +145,6 @@ static stc_s *__stc_manager_init(void) STC_LOGI("stc manager initialized"); __STC_LOG_FUNC_EXIT__; return stc; - -handle_error: - STC_LOGD("Failed to initialize stc manager"); //LCOV_EXCL_LINE - __stc_manager_deinit(); //LCOV_EXCL_LINE - return NULL; //LCOV_EXCL_LINE } stc_s *stc_get_manager(void)