Fix potential memory leak 45/301245/1
authorsooyeon <sooyeon.kim@samsung.com>
Mon, 13 Nov 2023 04:46:09 +0000 (13:46 +0900)
committersooyeon <sooyeon.kim@samsung.com>
Mon, 13 Nov 2023 04:46:09 +0000 (13:46 +0900)
Change-Id: Ie34bf3d8a9eb2a33edda06237023b1870d6eee94
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
server/ttsd_data.cpp
server/ttsd_engine_agent.c

index 3ab1ce6..efca767 100644 (file)
@@ -245,6 +245,9 @@ static void clean_data(app_data_s& app_data)
 
        app_data.m_speak_data.clear();
        app_data.m_wav_data.clear();
+
+       free(app_data.credential);
+       app_data.credential = nullptr;
 }
 
 int ttsd_data_delete_client(unsigned int uid)
index 1339a6d..f6719cd 100644 (file)
@@ -294,6 +294,11 @@ int ttsd_engine_agent_release()
                g_engine_info->engine_path = NULL;
        }
 
+       if (NULL != g_engine_info->callbacks) {
+               free(g_engine_info->callbacks);
+               g_engine_info->callbacks = NULL;
+       }
+
        free(g_engine_info);
        g_engine_info = NULL;