Fix a bug for using heap after free 09/188209/2
authorhyunuktak <hyunuk.tak@samsung.com>
Mon, 3 Sep 2018 05:01:06 +0000 (14:01 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Mon, 3 Sep 2018 05:19:01 +0000 (14:19 +0900)
Change-Id: I7bb7fa02324f919bd7d6aee99a2ceb0f8090a4bc
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
packaging/stc-manager.spec
src/stc-manager.c [changed mode: 0644->0755]

index b57a246..d84c351 100644 (file)
@@ -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
old mode 100644 (file)
new mode 100755 (executable)
index 58f6531..7b4876a
@@ -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)