aboutsummaryrefslogtreecommitdiff
path: root/clientapi/auth/storage
diff options
context:
space:
mode:
Diffstat (limited to 'clientapi/auth/storage')
-rw-r--r--clientapi/auth/storage/accounts/account_data_table.go4
-rw-r--r--clientapi/auth/storage/accounts/membership_table.go7
-rw-r--r--clientapi/auth/storage/accounts/threepid_table.go4
-rw-r--r--clientapi/auth/storage/devices/devices_table.go3
4 files changed, 9 insertions, 9 deletions
diff --git a/clientapi/auth/storage/accounts/account_data_table.go b/clientapi/auth/storage/accounts/account_data_table.go
index 080ca3f3..1b7484d8 100644
--- a/clientapi/auth/storage/accounts/account_data_table.go
+++ b/clientapi/auth/storage/accounts/account_data_table.go
@@ -90,6 +90,7 @@ func (s *accountDataStatements) selectAccountData(
if err != nil {
return
}
+ defer rows.Close() // nolint: errcheck
global = []gomatrixserverlib.ClientEvent{}
rooms = make(map[string][]gomatrixserverlib.ClientEvent)
@@ -114,8 +115,7 @@ func (s *accountDataStatements) selectAccountData(
global = append(global, ac)
}
}
-
- return
+ return global, rooms, rows.Err()
}
func (s *accountDataStatements) selectAccountDataByType(
diff --git a/clientapi/auth/storage/accounts/membership_table.go b/clientapi/auth/storage/accounts/membership_table.go
index 6185065c..7b7c50ac 100644
--- a/clientapi/auth/storage/accounts/membership_table.go
+++ b/clientapi/auth/storage/accounts/membership_table.go
@@ -122,11 +122,10 @@ func (s *membershipStatements) selectMembershipsByLocalpart(
for rows.Next() {
var m authtypes.Membership
m.Localpart = localpart
- if err := rows.Scan(&m.RoomID, &m.EventID); err != nil {
- return nil, err
+ if err = rows.Scan(&m.RoomID, &m.EventID); err != nil {
+ return
}
memberships = append(memberships, m)
}
-
- return
+ return memberships, rows.Err()
}
diff --git a/clientapi/auth/storage/accounts/threepid_table.go b/clientapi/auth/storage/accounts/threepid_table.go
index 5900260a..a03aa4f8 100644
--- a/clientapi/auth/storage/accounts/threepid_table.go
+++ b/clientapi/auth/storage/accounts/threepid_table.go
@@ -97,6 +97,7 @@ func (s *threepidStatements) selectThreePIDsForLocalpart(
if err != nil {
return
}
+ defer rows.Close() // nolint: errcheck
threepids = []authtypes.ThreePID{}
for rows.Next() {
@@ -110,8 +111,7 @@ func (s *threepidStatements) selectThreePIDsForLocalpart(
Medium: medium,
})
}
-
- return
+ return threepids, rows.Err()
}
func (s *threepidStatements) insertThreePID(
diff --git a/clientapi/auth/storage/devices/devices_table.go b/clientapi/auth/storage/devices/devices_table.go
index c5773ce3..99741247 100644
--- a/clientapi/auth/storage/devices/devices_table.go
+++ b/clientapi/auth/storage/devices/devices_table.go
@@ -226,6 +226,7 @@ func (s *devicesStatements) selectDevicesByLocalpart(
if err != nil {
return devices, err
}
+ defer rows.Close() // nolint: errcheck
for rows.Next() {
var dev authtypes.Device
@@ -237,5 +238,5 @@ func (s *devicesStatements) selectDevicesByLocalpart(
devices = append(devices, dev)
}
- return devices, nil
+ return devices, rows.Err()
}