diff options
author | cookie <cookie@samsung.com> | 2017-08-11 01:35:55 +0000 |
---|---|---|
committer | jaekuk lee <juku1999@samsung.com> | 2017-08-11 02:57:28 +0000 |
commit | d329990b960ce2bf6d0e7369dfad667c26e6e888 (patch) | |
tree | c7574aea2832976a98764514823e316ee17fdde9 | |
parent | 3fcdde2fcf746539d432fb553a5721ae5b0ea234 (diff) | |
download | browser-d329990b960ce2bf6d0e7369dfad667c26e6e888.tar.gz browser-d329990b960ce2bf6d0e7369dfad667c26e6e888.tar.bz2 browser-d329990b960ce2bf6d0e7369dfad667c26e6e888.zip |
Fix the PVS V522,V547,V668
[ Problem] There is the PVS Issue
[ Cause ]V522 There might be dereferencing of a potential null pointer 'msg'
V547 Expression 'itemData' is always true.
V668 There is no sense in testing the 'item_data' pointer against null
[ Soulution] fix the issue
Change-Id: I9eb8e085b00b262d216388b3dd2d5880c7813a68
Signed-off-by: cookie <cookie@samsung.com>
-rwxr-xr-x | services/QuickAccess/QuickAccess.cpp | 19 | ||||
-rwxr-xr-x | services/SettingsUI/SettingsAFCreator.cpp | 8 | ||||
-rwxr-xr-x | services/SettingsUI/SettingsUI.cpp | 18 |
3 files changed, 21 insertions, 24 deletions
diff --git a/services/QuickAccess/QuickAccess.cpp b/services/QuickAccess/QuickAccess.cpp index 7a14c91..40fe914 100755 --- a/services/QuickAccess/QuickAccess.cpp +++ b/services/QuickAccess/QuickAccess.cpp @@ -568,8 +568,7 @@ void QuickAccess::_grid_mostVisited_del(void *data, Evas_Object *) BROWSER_LOGD("[%s:%d]", __PRETTY_FUNCTION__, __LINE__); if (data) { auto itemData = static_cast<HistoryItemData*>(data); - if (itemData) - delete itemData; + delete itemData; } } @@ -740,13 +739,15 @@ void QuickAccess::setButtonColor(Evas_Object* button, int r, int g, int b, int a { // setting color of inner rect Edje_Message_Int_Set* msg = (Edje_Message_Int_Set *) malloc(sizeof(*msg) + 3 * sizeof(int)); - msg->count = 4; - msg->val[0] = r; - msg->val[1] = g; - msg->val[2] = b; - msg->val[3] = a; - edje_object_message_send(elm_layout_edje_get(button), EDJE_MESSAGE_INT_SET, 0, msg); - free(msg); + if (msg) { + msg->count = 4; + msg->val[0] = r; + msg->val[1] = g; + msg->val[2] = b; + msg->val[3] = a; + edje_object_message_send(elm_layout_edje_get(button), EDJE_MESSAGE_INT_SET, 0, msg); + free(msg); + } } bool QuickAccess::canBeBacked(int tabCount) diff --git a/services/SettingsUI/SettingsAFCreator.cpp b/services/SettingsUI/SettingsAFCreator.cpp index afc980e..c8663d5 100755 --- a/services/SettingsUI/SettingsAFCreator.cpp +++ b/services/SettingsUI/SettingsAFCreator.cpp @@ -91,7 +91,7 @@ void SettingsAFCreator::unregisterCallbacksForEditfield(Evas_Object* editfield) evas_object_smart_callback_del(button, "clicked", __entry_clear_button_clicked_cb); } -bool SettingsAFCreator::loadProfile(void) +void SettingsAFCreator::loadProfile(void) { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); @@ -108,16 +108,14 @@ bool SettingsAFCreator::loadProfile(void) } createNewAutoFillFormItem(); - - return false; } void SettingsAFCreator::createNewAutoFillFormItem() { BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); - if (!m_profile) + if (!m_profile) { m_item = std::make_shared<AutoFillFormItem>(nullptr); - else { + } else { auto item_data = new AutoFillFormItemData; if (!item_data) { BROWSER_LOGE("Malloc failed to get item_data"); diff --git a/services/SettingsUI/SettingsUI.cpp b/services/SettingsUI/SettingsUI.cpp index e1814b8..876129c 100755 --- a/services/SettingsUI/SettingsUI.cpp +++ b/services/SettingsUI/SettingsUI.cpp @@ -76,11 +76,11 @@ void SettingsUI::init() m_edjFilePath.append("SettingsUI/SettingsMobileUI.edj"); elm_theme_extension_add(nullptr, m_edjFilePath.c_str()); - m_setting_item_class = createItemClass("type1",_gengrid_item_text_get); - m_setting_double_item_class = createItemClass("type1",_gengrid_item_text_get); - m_setting_check_on_of_item_class = createItemClass("type1",_gengrid_item_text_get, _gengrid_item_content_onoff_get); - m_setting_check_normal_item_class = createItemClass("type1",_gengrid_item_text_get, _gengrid_item_content_normal_get); - m_setting_check_radio_item_class = createItemClass("type1",_gengrid_item_text_get, _gengrid_item_content_radio_get); + m_setting_item_class = createItemClass("type1", _gengrid_item_text_get); + m_setting_double_item_class = createItemClass("type1", _gengrid_item_text_get); + m_setting_check_on_of_item_class = createItemClass("type1", _gengrid_item_text_get, _gengrid_item_content_onoff_get); + m_setting_check_normal_item_class = createItemClass("type1", _gengrid_item_text_get, _gengrid_item_content_normal_get); + m_setting_check_radio_item_class = createItemClass("type1", _gengrid_item_text_get, _gengrid_item_content_radio_get); } void SettingsUI::init(Evas_Object* parent) @@ -192,7 +192,7 @@ void SettingsUI::orientationChanged() } } else { if (m_items_layout) { - elm_object_signal_emit(m_items_layout,"rotation,portrait,main", "rot"); + elm_object_signal_emit(m_items_layout, "rotation,portrait,main", "rot"); } } } @@ -224,12 +224,10 @@ char* SettingsUI::_gengrid_item_text_get(void* data, Evas_Object*, const char* p if (strcmp(part, "elm.text") == 0) { const char* item_name = it->buttonText.c_str(); - if (item_name) - return strdup(item_name); + return strdup(item_name); } else if (strcmp(part, "elm.text.sub") == 0 && !(it->subText.empty())) { const char* item_name = it->subText.c_str(); - if (item_name) - return strdup(item_name); + return strdup(item_name); } return nullptr; } |