mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 14:12:47 +00:00
Fix memory leaks with SQLite prepared statements (#2253)
This commit is contained in:
parent
5e694cd362
commit
22a034dcba
6 changed files with 34 additions and 20 deletions
|
@ -233,12 +233,13 @@ func (s *roomStatements) SelectRoomVersionsForRoomNIDs(
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
sqlPrep = sqlutil.TxStmt(txn, sqlPrep)
|
||||
defer sqlPrep.Close() // nolint:errcheck
|
||||
sqlStmt := sqlutil.TxStmt(txn, sqlPrep)
|
||||
iRoomNIDs := make([]interface{}, len(roomNIDs))
|
||||
for i, v := range roomNIDs {
|
||||
iRoomNIDs[i] = v
|
||||
}
|
||||
rows, err := sqlPrep.QueryContext(ctx, iRoomNIDs...)
|
||||
rows, err := sqlStmt.QueryContext(ctx, iRoomNIDs...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue