Memory leak fixes taken from MCD 4.0 31/226131/1
authorDharanie Shankar <dshankar.r@samsung.com>
Mon, 17 Feb 2020 06:25:38 +0000 (11:55 +0530)
committerWonnam Jang <wn.jang@samsung.com>
Thu, 27 Feb 2020 05:08:41 +0000 (05:08 +0000)
Change refno: 3284633, 3316074, 3316388

[Model]
[BinType] AP
[Customer] OPEN

[Issue#]
[Request] PLM
[Occurrence Version]

[Problem] bug fix
[Cause & Measure]
[Checking Method]

[Team] Bixby Client
[Developer] Dharanie Shankar
[Solution company] Samsung
[Change Type] PLM

Change-Id: Ia9d500d6e6030a2c2caeba8854ff96530aca4238
Signed-off-by: Dharanie Shankar <dshankar.r@samsung.com>
(cherry picked from commit 8db9160f0cbfa62afbf8da366033f7ec41640d70)

client/vc_mgr.c
client/vc_mgr_data.cpp
common/vc_config_parser.c

index eb6c3b8..855c6f9 100644 (file)
@@ -4194,6 +4194,10 @@ static void __tts_feedback_thread(void* data, Ecore_Thread* thread)
                                /* If no feedback data and EVENT_FINISH */
                                if (0 >= vc_mgr_data_get_feedback_data_size() && VC_FEEDBACK_EVENT_FINISH == feedback_data->event) {
                                        SLOG(LOG_INFO, TAG_VCM, "[INFO] Finish feedback");
+                                       if (feedback_data) {
+                                               free(feedback_data);
+                                               feedback_data = NULL;
+                                       }
                                        break;
                                }
                        } else {
@@ -4220,6 +4224,10 @@ static void __tts_feedback_thread(void* data, Ecore_Thread* thread)
                                /* If no feedback data and EVENT_FINISH */
                                if (0 >= vc_mgr_data_get_feedback_data_size() && VC_FEEDBACK_EVENT_FINISH == feedback_data->event) {
                                        SLOG(LOG_INFO, TAG_VCM, "[INFO] Finish vc tts feedback");
+                                       if (feedback_data) {
+                                               free(feedback_data);
+                                               feedback_data = NULL;
+                                       }
                                        break;
                                }
                        }
index 53adae3..8301fcd 100644 (file)
@@ -100,18 +100,16 @@ int vc_mgr_data_clear_feedback_data(vc_feedback_data_s** data)
 
        pthread_mutex_lock(&g_feedback_data_mutex);
 
-       if (!g_feedback_data.empty()) {
-               if (NULL != *data) {
-                       SLOG(LOG_INFO, TAG_VCM, "[DEBUG] pid(%d), utt_id(%d), data(%p) size(%d) rate(%d)", (*data)->pid, (*data)->utt_id, (*data)->data, (*data)->data_size, (*data)->rate);
-
-                       if (NULL != (*data)->data) {
-                               free((*data)->data);
-                               (*data)->data = NULL;
-                       }
+       if (NULL != *data) {
+               SLOG(LOG_INFO, TAG_VCM, "[DEBUG] pid(%d), utt_id(%d), data(%p) size(%d) rate(%d)", (*data)->pid, (*data)->utt_id, (*data)->data, (*data)->data_size, (*data)->rate);
 
-                       free(*data);
-                       *data = NULL;
+               if (NULL != (*data)->data) {
+                       free((*data)->data);
+                       (*data)->data = NULL;
                }
+
+               free(*data);
+               *data = NULL;
        }
 
        pthread_mutex_unlock(&g_feedback_data_mutex);
index e2be6d8..cf7e088 100644 (file)
@@ -243,6 +243,8 @@ int vc_parser_free_engine_info(vc_engine_info_s* engine_info)
 
        if (NULL != engine_info->name)          free(engine_info->name);
        if (NULL != engine_info->uuid)          free(engine_info->uuid);
+       if (NULL != engine_info->default_lang)          free(engine_info->default_lang);
+       if (NULL != engine_info->setting)               free(engine_info->setting);
 
        int count = g_slist_length(engine_info->languages);