pg: call PQclean in rows()

pull/5500/head
jhuntos 2020-06-26 11:55:59 +02:00 committed by GitHub
parent 202d479bad
commit 20884c9576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,7 @@ fn C.PQntuples(voidptr) int
fn C.PQnfields(voidptr) int fn C.PQnfields(voidptr) int
fn C.PQexec(voidptr) voidptr fn C.PQexec(voidptr) voidptr
fn C.PQexecParams(voidptr) voidptr fn C.PQexecParams(voidptr) voidptr
fn C.PQclear(voidptr) voidptr
pub fn connect(config Config) ?DB { pub fn connect(config Config) ?DB {
conninfo := 'host=$config.host port=$config.port user=$config.user dbname=$config.dbname password=$config.password' conninfo := 'host=$config.host port=$config.port user=$config.user dbname=$config.dbname password=$config.password'
@ -61,6 +62,7 @@ fn res_to_rows(res voidptr) []Row {
} }
rows << row rows << row
} }
C.PQclear(res)
return rows return rows
} }