From: bert hubert Date: Sun, 11 Sep 2016 18:40:44 +0000 (+0200) Subject: eleksir noted that we leak a ton of memory in postgresql. I'm no postgres expert... X-Git-Tag: dnsdist-1.1.0-beta2~126^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=903bb4924bc5130c0e81f0c5759d0177f53e82fd;p=pdns eleksir noted that we leak a ton of memory in postgresql. I'm no postgres expert, but this plugs my leak and still appears to function. In other news, do we need a transaction for every query? --- diff --git a/modules/gpgsqlbackend/spgsql.cc b/modules/gpgsqlbackend/spgsql.cc index 860a2db47..ed80d4c53 100644 --- a/modules/gpgsqlbackend/spgsql.cc +++ b/modules/gpgsqlbackend/spgsql.cc @@ -77,7 +77,8 @@ public: L<in_trx()) { - PQexec(d_db(),"BEGIN"); + auto res=PQexec(d_db(),"BEGIN"); + PQclear(res); d_do_commit = true; } else d_do_commit = false; d_res_set = PQexecPrepared(d_db(), d_stmt.c_str(), d_nparams, paramValues, paramLengths, NULL, 0);