From 83a531823a30a956a51d613f9eeb1a6633b84d5f Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 5 Jul 2016 16:34:08 +0900 Subject: [PATCH] fix potential issue detected with static analyzer Change-Id: I6a5539b1977013d59ab7d27aa772a3bf983493f8 Signed-off-by: sungwook79.park --- src/w-input-stt-ise.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/w-input-stt-ise.cpp b/src/w-input-stt-ise.cpp index 54b54f4..965d36d 100755 --- a/src/w-input-stt-ise.cpp +++ b/src/w-input-stt-ise.cpp @@ -46,20 +46,22 @@ void show_voice_input(Evas_Object *parent, const char *lang, void (*get_string)( my_voicedata = (VoiceData*)malloc(sizeof(VoiceData)); if (my_voicedata == NULL) { PRINTFUNC(DLOG_ERROR, "%d::::Heap Overflow, Voice Input cannot be shown!", __LINE__); - return; + return; } memset(my_voicedata, 0, sizeof(VoiceData)); } - init = init_voice(parent, lang, my_voicedata); - if (init) { - if (my_voicedata->naviframe) { - show_voice_window(my_voicedata->naviframe, my_voicedata); + if (my_voicedata) { + init = init_voice(parent, lang, my_voicedata); + if (init) { + if (my_voicedata->naviframe) { + show_voice_window(my_voicedata->naviframe, my_voicedata); + } + } else { + destroy_voice(); + PRINTFUNC(DLOG_ERROR, "%d::::Fail to create Voice window!", __LINE__); + return; } - } else { - destroy_voice(); - PRINTFUNC(DLOG_ERROR, "%d::::Fail to create Voice window!", __LINE__); - return; } vconf_notify_key_changed(VCONFKEY_ISE_STT_LANGUAGE, _stt_lang_changed_cb, my_voicedata); -- 2.7.4