[svace] checked null before using pointer
[platform/core/pim/calendar-service.git] / server / cal_server_alarm.c
index dfb90f7..4c115c4 100644 (file)
@@ -347,14 +347,6 @@ static int cal_server_alarm_get_alert_time(int alarm_id, time_t *tt_alert)
                dtend_type = sqlite3_column_int(stmt, 8);
        }
 
-       if (NULL == tt_alert) {
-               /* LCOV_EXCL_START */
-               ERR("Invalid parameter: tt_alert is NULL");
-               sqlite3_finalize(stmt);
-               return CALENDAR_ERROR_INVALID_PARAMETER;
-               /* LCOV_EXCL_STOP */
-       }
-
        if (CALENDAR_ALARM_TIME_UNIT_SPECIFIC == unit) {
                if (CALENDAR_TIME_UTIME == type) {
                        *tt_alert = utime;
@@ -945,6 +937,10 @@ static bool __app_matched_cb(app_control_h app_control, const char *package, voi
        }
        GList *cursor = g_list_first(alarm_list);
        for (i = 0; i < len; i++) {
+               if (NULL == cursor){
+                       ERR("cursor is NULL");
+                       break;
+               }
                struct _alarm_data_s *ad = (struct _alarm_data_s *)cursor->data;
                if (NULL == ad) {
                        WARN("No data");