From 630c268f28114c2f94af946cc621b044f9202351 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 21 May 2018 09:43:08 +0900 Subject: [PATCH] Check return value Change-Id: I78924a1af46894595522f089d32cf9124d72e98b Signed-off-by: Jihoon Kim --- src/voice-recorder.cpp | 5 ++++- src/w-input-emoticon.cpp | 15 ++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/voice-recorder.cpp b/src/voice-recorder.cpp index 841724d..3727b38 100644 --- a/src/voice-recorder.cpp +++ b/src/voice-recorder.cpp @@ -188,7 +188,10 @@ static void _recorder_apply_settings(voice_recorder *recorder) if (error_code != RECORDER_ERROR_NONE) LOGW("Failed to set audio channel. error code : %d", error_code); - recorder_attr_set_audio_device(recorder->recorder, RECORDER_AUDIO_DEVICE_MIC); + error_code = recorder_attr_set_audio_device(recorder->recorder, RECORDER_AUDIO_DEVICE_MIC); + if (error_code != RECORDER_ERROR_NONE) + LOGW("Failed to set audio device. error code : %d", error_code); + error_code = recorder_attr_set_time_limit(recorder->recorder, MAX_TIME); if (error_code != RECORDER_ERROR_NONE) LOGW("Failed to set time limit. error code : %d", error_code); diff --git a/src/w-input-emoticon.cpp b/src/w-input-emoticon.cpp index 8ffd747..6c5c902 100755 --- a/src/w-input-emoticon.cpp +++ b/src/w-input-emoticon.cpp @@ -373,13 +373,14 @@ void set_recent_emoticons(vector &emoticon_list, int val) static void _drawing_app_control_reply_cb(app_control_h request, app_control_h reply, app_control_result_e result, void *user_data) { char* path = NULL; - app_control_get_extra_data(reply, APP_CONTROL_DATA_PATH, &path); - - if (path){ - PRINTFUNC(DLOG_DEBUG, "path=%s", path); - char *pathes[] = {path, }; - reply_to_sender_by_callback(NULL, "image", (const char **)pathes, NULL); - free(path); + int ret = app_control_get_extra_data(reply, APP_CONTROL_DATA_PATH, &path); + if (ret == APP_CONTROL_ERROR_NONE) { + if (path){ + PRINTFUNC(DLOG_DEBUG, "path=%s", path); + char *pathes[] = {path, }; + reply_to_sender_by_callback(NULL, "image", (const char **)pathes, NULL); + free(path); + } } ui_app_exit(); } -- 2.7.4