[pgpool-committers: 5579] pgpool: Fix memory leak in "batch" mode in extended query.
ishii at sraoss.co.jp
Fri Mar 29 16:15:01 JST 2019
Fix memory leak in "batch" mode in extended query.
In "batch" mode, not for every execute message, a sync message is
followed. Unfortunately Pgpool-II only discard memory of query
context for the last execute message while processing the ready for
query message. For example if 3 execute messages are sent before the
sync message, 2 of query context memory will not be freed and this
leads to serious memory leak.
To fix the problem, now the query context memory is possibly discarded
when a command complete message is returned from backend if the query
context is not referenced either by sent messages or pending messages.
If it is not referenced at all, we can discard the query context.
Also even if it is referenced, it is ok to discard the query context
if it is either an unnamed statement or an unnamed portal because it
will be discarded anyway when next unnamed statement or portal is
Per bug 468.
src/context/pool_session_context.c | 49 +++++++++++++++++++++++++++++-
src/include/context/pool_session_context.h | 2 ++
src/protocol/CommandComplete.c | 25 +++++++++++++++
3 files changed, 75 insertions(+), 1 deletion(-)
More information about the pgpool-committers