[pgpool-committers: 5311] pgpool: Fix memory leak in extended query + query cache enabled.

Tatsuo Ishii ishii at sraoss.co.jp
Thu Nov 1 09:37:43 JST 2018


Fix memory leak in extended query + query cache enabled.

If a bind message is sent again to an existing prepared statement, it
is possible that the previously allocated bind parameter string
remains and newly allocated bind parameter string's pointer is set to
there, which leads to a memory leak.

Note that if a statement is parsed again in usual way, the parameter
string will be freed along with the old query context. So the leak
does not happen.

I suspect the use case for the memory leak (bind, execute is repeated
against a same prepared statement) is actually rare in the
field. Probably that's why the problem has not been reported until
today although the leak had existed since day 0.

The leak case can be easily reproduced by "pgbench -M prepared" by the
way.

Branch
------
V3_4_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=ca3dc43994e7474826f7485692a49f60d36c9807

Modified Files
--------------
src/protocol/pool_proto_modules.c | 10 ++++++++++
1 file changed, 10 insertions(+)



More information about the pgpool-committers mailing list