From 99f08bf3eda524fdf9fc8e44fe7a9e0dca3f0ff7 Mon Sep 17 00:00:00 2001 From: Suyeon Hwang Date: Thu, 9 Jul 2020 19:22:16 +0900 Subject: [PATCH] Add null check about client list from tts_client Change-Id: I6ae21d38aa2f3878e90532ca73e63626ce8bfd67 Signed-off-by: Suyeon Hwang --- client/tts.c | 10 ++++++++++ client/tts_client.c | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/client/tts.c b/client/tts.c index 4ab960f..e8428a0 100644 --- a/client/tts.c +++ b/client/tts.c @@ -139,6 +139,11 @@ void __tts_config_voice_changed_cb(const char* before_lang, int before_voice_typ GList* client_list = NULL; client_list = tts_client_get_client_list(); + if (NULL == client_list) { + SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to get client list"); + return; + } + GList *iter = NULL; tts_client_s *data = NULL; @@ -2374,6 +2379,11 @@ int __tts_cb_error(int uid, tts_error_e reason, int utt_id, char* err_msg) GList* client_list = NULL; client_list = tts_client_get_client_list(); + if (NULL == client_list) { + SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to get client list"); + return TTS_ERROR_OPERATION_FAILED; + } + GList *iter = NULL; tts_client_s *data = NULL; diff --git a/client/tts_client.c b/client/tts_client.c index 1bbcae1..0ed68a8 100644 --- a/client/tts_client.c +++ b/client/tts_client.c @@ -319,7 +319,6 @@ int tts_client_get_mode_client_count(tts_mode_e mode) return number; } -// FIXME: remove this function GList* tts_client_get_client_list() { GList* copy_list = NULL; -- 2.7.4