From 20884c9576fb3265114ca4896840d3e1e85a8777 Mon Sep 17 00:00:00 2001 From: jhuntos Date: Fri, 26 Jun 2020 11:55:59 +0200 Subject: [PATCH] pg: call PQclean in rows() --- vlib/pg/pg.v | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vlib/pg/pg.v b/vlib/pg/pg.v index cbac7269e9..4a52926e09 100644 --- a/vlib/pg/pg.v +++ b/vlib/pg/pg.v @@ -36,6 +36,7 @@ fn C.PQntuples(voidptr) int fn C.PQnfields(voidptr) int fn C.PQexec(voidptr) voidptr fn C.PQexecParams(voidptr) voidptr +fn C.PQclear(voidptr) voidptr pub fn connect(config Config) ?DB { 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 } + C.PQclear(res) return rows }