From: wn.jang Date: Thu, 8 Oct 2020 10:28:55 +0000 (+0900) Subject: Fix defects detected by static analysis X-Git-Tag: accepted/tizen/6.0/unified/20201030.105319^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F245427%2F2;p=platform%2Fcore%2Fuifw%2Fstt.git Fix defects detected by static analysis Change-Id: Idff4c4459165f19351b81d1d275a41c7fc498a06 --- diff --git a/client/stt.c b/client/stt.c index 90d8dec..2c7b22a 100644 --- a/client/stt.c +++ b/client/stt.c @@ -1220,9 +1220,15 @@ int stt_foreach_supported_languages(stt_h stt, stt_supported_language_cb callbac if (NULL == client->current_engine_id) { ret = stt_config_mgr_get_engine(¤t_engine_id); + if (NULL == current_engine_id) { + SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to allocate memory or Engine id is NULL"); + return STT_ERROR_OPERATION_FAILED; + } ret = __stt_convert_config_error_code(ret); if (0 != ret) { SLOG(LOG_ERROR, TAG_STTC, "[ERROR] Fail to get default engine id : %s", __stt_get_error_code(ret)); //LCOV_EXCL_LINE + free(current_engine_id); + current_engine_id = NULL; return ret; } } else {