From: Jihoon Kim Date: Thu, 27 Jun 2024 07:23:56 +0000 (+0900) Subject: Fix issues detected by static analysis tool X-Git-Tag: accepted/tizen/unified/20240627.162326~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89dc967f03b611f83764e3d87b43e78c87c4700d;p=platform%2Fcore%2Fuifw%2Finputdelegator.git Fix issues detected by static analysis tool Change-Id: Ib53bb3348eb3ded9fc4d5353fce850db19f1e8f2 Signed-off-by: Jihoon Kim --- diff --git a/src/w-input-stt-ise.cpp b/src/w-input-stt-ise.cpp index 2702578..aecea36 100644 --- a/src/w-input-stt-ise.cpp +++ b/src/w-input-stt-ise.cpp @@ -44,8 +44,10 @@ void show_voice_input(Evas_Object *parent, const char *lang, void (*get_string)( //stt_feedback_initialize(); if (!my_voicedata) { - my_voicedata = new VoiceData; - if (my_voicedata == NULL) { + try { + my_voicedata = new VoiceData; + } + catch (std::bad_alloc &e) { PRINTFUNC(DLOG_ERROR, "%d::::Heap Overflow, Voice Input cannot be shown!", __LINE__); return; } diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 4735348..1629f72 100644 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -541,8 +541,8 @@ static Eina_Bool _idler_cb(void *data) Evas_Object *canvas = elm_object_part_content_get(voicedata->layout_main, "EFFECT_BG"); - is::ui::WInputSttMicEffect *ieffect = new is::ui::WInputSttMicEffect(); - if (ieffect) { + try { + is::ui::WInputSttMicEffect *ieffect = new is::ui::WInputSttMicEffect(); if (voicedata->sttmanager) ieffect->SetSttHandle(voicedata->sttmanager->GetSttHandle()); @@ -553,6 +553,9 @@ static Eina_Bool _idler_cb(void *data) if (voicedata->progressbar) ieffect->SetProgressBar(voicedata->progressbar); } + catch (std::bad_alloc &e) { + PRINTFUNC(DLOG_ERROR, "Failed to alloc Mic effect"); + } voicedata->mo->Update();