Fix coverity issue (CID 108032 110691 109292 107803) 17/174817/1
authorsinikang <sinikang@samsung.com>
Wed, 4 Apr 2018 09:22:03 +0000 (18:22 +0900)
committersinikang <sinikang@samsung.com>
Wed, 4 Apr 2018 09:22:03 +0000 (18:22 +0900)
Change-Id: I7419acbd44dc920c517879f0d1f6c3e3432f9497

module/src/callmgr-contact.c
packaging/call-manager.spec

index b2f99c081a46c52d0bb116499529fa0395a20648..980daba8b3517ff063921791a06e7c6ab9291b5f 100644 (file)
@@ -245,9 +245,13 @@ int _callmgr_ct_get_is_favorite_by_num(const char *phone_number, int *is_favorit
                contacts_list_first(list);
 
                while (CONTACTS_ERROR_NONE == contacts_list_get_current_record_p(list, &record)) {
-                       contacts_record_get_bool(record, _contacts_person_number.is_favorite, &b_favorite);
+                       err = contacts_record_get_bool(record, _contacts_person_number.is_favorite, &b_favorite);
+                       if (CONTACTS_ERROR_NONE != err)
+                               err("contacts_record_get_bool is error");
+
                        *is_favorite = b_favorite;
                        info("is_favorite %d", *is_favorite);
+
                        err = contacts_list_next(list);
                        if (CONTACTS_ERROR_NONE != err)
                                break;
@@ -743,6 +747,7 @@ static void __callmgr_ct_add_notification(int missed_cnt)
        _callmgr_util_get_pkg_name(CM_UTIL_PKG_ID_PHONE, &phone_pkg_name);
        if (!phone_pkg_name) {
                err("phone_pkg_name is NULL");
+               notification_free(noti);
                return;
        }
 
@@ -810,6 +815,7 @@ static void __callmgr_ct_add_notification(int missed_cnt)
        error = contacts_connect();
        if (error != CONTACTS_ERROR_NONE) {
                err("contacts_connect() failed [%d](%s)", error, get_error_message(error));
+               notification_free(noti);
                return;
        }
 
@@ -972,9 +978,13 @@ static void __callmgr_ct_add_notification(int missed_cnt)
                                err("Fail to notification_set_text : %d", noti_err);
                        }
 
-                       if ((CONTACTS_ERROR_NONE != error)
-                               || (log_cnt == 2))
+                       if ((CONTACTS_ERROR_NONE != error) || (log_cnt == 2)) {
+                               if (disp_str) {
+                                       g_free(disp_str);
+                                       disp_str = NULL;
+                               }
                                break;
+                       }
                }
        }
 
@@ -1178,6 +1188,7 @@ static void __callmgr_ct_add_rec_reject_notification(char *number, int person_id
        _callmgr_util_get_pkg_name(CM_UTIL_PKG_ID_PHONE, &phone_pkg_name);
        if (!phone_pkg_name) {
                err("phone_pkg_name is NULL");
+               noti_err = notification_free(noti);
                return;
        }
 
index 82824c77032a456a24f21f66e514d93246660c0a..11bdf2c1a4f24e74e24b7e6188b51b6a0b3067b6 100644 (file)
@@ -1,6 +1,6 @@
 %define major 0
 %define minor 2
-%define patchlevel 46
+%define patchlevel 47
 %define ext_feature 0
 
 Name:           call-manager