pass: resmon: Remove duplicate free operation of monitor instance 42/174942/6 accepted/tizen/unified/20180410.063557 submit/tizen/20180409.024353
authorChanwoo Choi <cw00.choi@samsung.com>
Wed, 4 Apr 2018 04:05:54 +0000 (13:05 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 6 Apr 2018 06:01:01 +0000 (15:01 +0900)
Change-Id: Ibbaa488ec6d42e1f566ec9bab847411fed992ba0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/pass/pass-resmon.c

index 9736870f474fff392283cf60885b49557621f339..fe45b5fcfb246b2d89d0f9f48ebcf78605275b42 100644 (file)
@@ -172,6 +172,9 @@ static int resmon_timer_delete(struct resmon *monitor)
        resmon->timer_list = g_list_remove(resmon->timer_list,
                                        (gpointer)monitor);
 
+       free(monitor);
+       monitor = NULL;
+
        return 0;
 }
 
@@ -218,9 +221,6 @@ static gboolean resmon_timer_func(gpointer data)
                                res->config_data.res_name, monitor->src_type);
                        return false;
                }
-
-               free(monitor);
-               monitor = NULL;
                break;
        case RESMON_TIMER_PERIODIC:
                break;
@@ -338,10 +338,6 @@ int pass_resmon_unregister_timer(struct pass_resource *res,
                                        res->config_data.res_type, src_type);
        }
 
-       /* Free the memory of resource monitor */
-       free(monitor);
-       monitor = NULL;
-
        return 0;
 }