Added the missing parts for free'ing ptts_id 34/317934/1
authordyamy-lee <dyamy.lee@samsung.com>
Thu, 19 Sep 2024 10:52:22 +0000 (19:52 +0900)
committerdyamy-lee <dyamy.lee@samsung.com>
Thu, 19 Sep 2024 10:52:22 +0000 (19:52 +0900)
Change-Id: Iea8ba59775d09e9b40a77264bcbd61142c7d307e

server/ttsd_server.c

index e6a32d0b8a4ff8f26a832513fe17d2c412ef338d..494d47c3449e69d4c889316c0f9da40b11207894 100644 (file)
@@ -1120,6 +1120,10 @@ int ttsd_server_add_text(unsigned int uid, const char* text, const char* lang, i
 
        if (NULL == temp_lang) {
                SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to select valid voice : result lang is NULL");
+               if (NULL != temp_ptts_id) {
+                       free(temp_ptts_id);
+                       temp_ptts_id = NULL;
+               }
                return TTSD_ERROR_INVALID_VOICE;
        }
 
@@ -1228,6 +1232,10 @@ int ttsd_server_add_text_with_synthesis_parameter(unsigned int uid, const char*
 
        if (NULL == temp_lang) {
                SLOG(LOG_ERROR, tts_tag(), "[Server ERROR] Fail to select valid voice : result lang is NULL");
+               if (NULL != temp_ptts_id) {
+                       free(temp_ptts_id);
+                       temp_ptts_id = NULL;
+               }
                return TTSD_ERROR_INVALID_VOICE;
        }