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: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4459%2Fhead;p=thirdparty%2Fpdns.git 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 860a2db47b..ed80d4c53b 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);