From 9e46ec6ca38a26e56a01d1fa96d5a573adaa0511 Mon Sep 17 00:00:00 2001 From: "wn.jang" Date: Thu, 8 Oct 2020 19:28:55 +0900 Subject: [PATCH] Fix defects detected by static analysis Change-Id: Idff4c4459165f19351b81d1d275a41c7fc498a06 --- client/stt.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 { -- 2.7.4