Fix issue that detected by static analysis tool 07/141407/1
authorsungwook79.park <sungwook79.park@samsung.com>
Mon, 31 Jul 2017 09:02:06 +0000 (18:02 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Mon, 31 Jul 2017 09:02:06 +0000 (18:02 +0900)
Change-Id: I1f788bcc544e6726c071d9d1d5b999709122df15
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
src/ise-stt-mode.cpp

index 579a769..7a915a1 100644 (file)
@@ -488,6 +488,44 @@ static Evas_Object *create_progressbar(Evas_Object *parent)
     return progressbar;
 }
 
+int init_voicedata(VoiceData *r_voicedata)
+{
+    VoiceData *voicedata = (VoiceData *)r_voicedata;
+    if (!voicedata) {
+        return FALSE;
+    }
+
+    voicedata->voicefw_state = 0;
+    voicedata->voicefw_handle = NULL;
+    voicedata->naviframe = NULL;
+    voicedata->layout_main = NULL;
+    voicedata->progressbar = NULL;
+    voicedata->scroller = NULL;
+    voicedata->main_entry = NULL;
+    voicedata->mic_button = NULL;
+    voicedata->state = STT_STATE_VAL_INIT;
+    voicedata->kbd_lang = NULL;
+    voicedata->start_timer = NULL;
+    voicedata->refresh_timer = NULL;
+    voicedata->progressbar_timer = NULL;
+    voicedata->textblock_timer = NULL;
+    voicedata->guide_text_timer = NULL;
+    voicedata->btn_disabling_timer = NULL;
+    voicedata->power_unlock_timer = NULL;
+    voicedata->init_timer = NULL;
+
+    voicedata->stt_results.clear();
+    voicedata->partial_result = NULL;
+    voicedata->result_type = 0;
+    voicedata->disclaimer = 0;
+    voicedata->sttfeedback = NULL;
+    voicedata->sttmanager = NULL;
+    voicedata->ieffect = NULL;
+    voicedata->effector = NULL;
+
+    return TRUE;
+}
+
 int init_voice(Evas_Object *parent, const char *lang, VoiceData *r_voicedata)
 {
     LOGD("init_voice");
@@ -772,7 +810,7 @@ void show_voice_input(Evas_Object *parent, const char *lang, void (*get_string)(
             LOGD("%d::::Heap Overflow, Voice Input cannot be shown!", __LINE__);
             return;
         }
-        memset(my_voicedata, 0, sizeof(VoiceData));
+        init_voicedata(my_voicedata);
     }
 
     if (my_voicedata) {