From 899a046ae55500a1aa920c46b0a37c49bb754c0e Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 13 Mar 2018 16:13:37 +0900 Subject: [PATCH] Fix issue detected by static analysis tool Change-Id: I0d5c5bb7a2734b46774d1705338b63850c33c124 Signed-off-by: sungwook79.park --- src/voice-recorder.cpp | 1 + src/w-input-keyboard.cpp | 1 + src/w-input-selector.cpp | 4 +++- src/w-input-stt-voice.cpp | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/voice-recorder.cpp b/src/voice-recorder.cpp index 9c6a880..98b8a05 100644 --- a/src/voice-recorder.cpp +++ b/src/voice-recorder.cpp @@ -161,6 +161,7 @@ static void _recorder_start(voice_recorder *recorder) snprintf(recorder->file_path, PATH_MAX, "%s/%s", voice_content_path, filename); LOGD("recorder->file_path = %s", recorder->file_path); _recorder_apply_settings(recorder); + free(voice_content_path); recorder_prepare(recorder->recorder); recorder_start(recorder->recorder); } diff --git a/src/w-input-keyboard.cpp b/src/w-input-keyboard.cpp index 4e80c6c..774fe4c 100644 --- a/src/w-input-keyboard.cpp +++ b/src/w-input-keyboard.cpp @@ -111,6 +111,7 @@ void exit_keyboard() set_source_caller_app_id(app_control); free(app_id); reply_to_sender_by_callback(getText, "keyboard", NULL, cursorPosition); + app_control_destroy(app_control); ui_app_exit(); } diff --git a/src/w-input-selector.cpp b/src/w-input-selector.cpp index 7be1bbf..e232210 100644 --- a/src/w-input-selector.cpp +++ b/src/w-input-selector.cpp @@ -1034,8 +1034,10 @@ unsigned int _update_smartreply_items(void *user_data) app_data); item_size++; - if (item_size >= 3) + free(reply); + if (item_size >= 3) { break; + } } elm_genlist_item_class_free(itc); } diff --git a/src/w-input-stt-voice.cpp b/src/w-input-stt-voice.cpp index 00dbbfb..63f4c31 100644 --- a/src/w-input-stt-voice.cpp +++ b/src/w-input-stt-voice.cpp @@ -1587,6 +1587,9 @@ static void _stt_entry_clicked_cb(void *data, Evas_Object * obj, void *event_inf elm_naviframe_item_pop_cb_set(navi_it, __stt_entry_detailed_view_pop_cb, (void *)voicedata); elm_naviframe_item_title_enabled_set(navi_it, EINA_FALSE, EINA_FALSE); free(str); + } else { + if (str) free(str); + str = NULL; } return; -- 2.7.4