Checking null before deference 80/76680/3 accepted/tizen/common/20160627.192316 accepted/tizen/ivi/20160628.015027 accepted/tizen/mobile/20160628.015050 accepted/tizen/tv/20160628.015006 accepted/tizen/wearable/20160628.015041 submit/tizen/20160627.120306
authorWonnam Jang <wn.jang@samsung.com>
Mon, 27 Jun 2016 01:09:55 +0000 (10:09 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Mon, 27 Jun 2016 09:56:52 +0000 (18:56 +0900)
Change-Id: I211762300b389fd4299e75bdbba2b692df6dd55d
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
common/stt_config_mgr.c

index a44f27e..3fd7844 100644 (file)
@@ -1085,8 +1085,14 @@ int stt_config_mgr_set_engine(const char* engine)
                if (false == is_valid_lang) {
                        if (NULL != g_config_info->language) {
                                free(g_config_info->language);
+                               g_config_info->language = NULL;
 
                                iter_lang = g_slist_nth(engine_info->languages, 0);
+                               if (NULL == iter_lang) {
+                                       SLOG(LOG_ERROR, stt_tag(), "Fail to get default language");
+                                       break;
+                               }
+
                                lang = iter_lang->data;
 
                                g_config_info->language = strdup(lang);