Fix direct leak 49/119549/1
authorsooyeon.kim <sooyeon.kim@samsung.com>
Mon, 13 Mar 2017 07:00:56 +0000 (16:00 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Fri, 17 Mar 2017 08:29:55 +0000 (01:29 -0700)
Change-Id: I51d8fbbaa46a3a318b3e1a3102c0e21269b9690c
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
(cherry picked from commit b8f1f78a4f93753984e63e7ead6f246da7faf1fe)

server/vcd_engine_agent.c

index 8166f36e143915b2a4620205d54382fb7c1c2735..0c9faa77602927b41faf8fcb206f35425536919f 100755 (executable)
@@ -173,15 +173,15 @@ int vcd_engine_agent_release()
 
                        if (NULL != data) {
                                if (NULL != data->engine_uuid) {
-                                       free(data->engine_uuid);
+                                       g_free(data->engine_uuid);
                                        data->engine_uuid = NULL;
                                }
                                if (NULL != data->engine_name) {
-                                       free(data->engine_name);
+                                       g_free(data->engine_name);
                                        data->engine_name = NULL;
                                }
                                if (NULL != data->engine_path) {
-                                       free(data->engine_path);
+                                       g_free(data->engine_path);
                                        data->engine_path = NULL;
                                }
 
@@ -266,9 +266,9 @@ int vcd_engine_agent_initialize_current_engine()
        } else {
                if (NULL != g_dynamic_engine.engine_uuid) {
                        /* set data from g_engine_list */
-                       if (g_dynamic_engine.engine_uuid != NULL)       free(g_dynamic_engine.engine_uuid);
-                       if (g_dynamic_engine.engine_name != NULL)       free(g_dynamic_engine.engine_name);
-                       if (g_dynamic_engine.engine_path != NULL)       free(g_dynamic_engine.engine_path);
+                       if (g_dynamic_engine.engine_uuid != NULL)       g_free(g_dynamic_engine.engine_uuid);
+                       if (g_dynamic_engine.engine_name != NULL)       g_free(g_dynamic_engine.engine_name);
+                       if (g_dynamic_engine.engine_path != NULL)       g_free(g_dynamic_engine.engine_path);
                }
 
                g_dynamic_engine.engine_uuid = g_strdup(dynamic_engine->engine_uuid);
@@ -419,9 +419,13 @@ int __internal_update_engine_list()
                        data = iter->data;
 
                        if (NULL != data) {
-                               if (NULL != data->engine_uuid)          free(data->engine_uuid);
-                               if (NULL != data->engine_path)          free(data->engine_path);
-                               if (NULL != data->engine_name)          free(data->engine_name);
+                               if (NULL != data->engine_uuid)          g_free(data->engine_uuid);
+                               if (NULL != data->engine_path)          g_free(data->engine_path);
+                               if (NULL != data->engine_name)          g_free(data->engine_name);
+
+                               data->engine_uuid = NULL;
+                               data->engine_path = NULL;
+                               data->engine_name = NULL;
 
                                free(data);
                        }