From: sooyeon Date: Fri, 16 Feb 2024 05:12:10 +0000 (+0900) Subject: Fix svace issue (add null checker) X-Git-Tag: accepted/tizen/unified/20240313.134754~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31d85f64188c10c477fce3b8259e6e7f4c1ccdc7;p=platform%2Fcore%2Fuifw%2Fstt.git Fix svace issue (add null checker) Change-Id: I6c7c6b11589b24bb6ea2b9587a8ba8bc9857b247 Signed-off-by: sooyeon --- diff --git a/server/sttd_engine_agent.c b/server/sttd_engine_agent.c index c06eb8d..79ca9a5 100644 --- a/server/sttd_engine_agent.c +++ b/server/sttd_engine_agent.c @@ -99,6 +99,10 @@ int sttd_engine_agent_init(result_callback result_cb, result_time_callback time_ if (0 != sttd_config_get_default_language(&(g_default_language))) { SLOG(LOG_WARN, TAG_STTD, "[Engine Agent WARNING] There is No default voice in config"); /* Set default voice */ + if (NULL != g_default_language) { + free(g_default_language); + g_default_language = NULL; + } g_default_language = strdup("en_US"); } else { SLOG(LOG_DEBUG, TAG_STTD, "[Engine Agent] Default language is %s", g_default_language);