From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix memory leak in printtup.c. |
Date: | 2019-03-18 21:55:11 |
Message-ID: | E1h60Dv-0008Gn-0n@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix memory leak in printtup.c.
Commit f2dec34e1 changed things so that printtup's output stringinfo
buffer was allocated outside the per-row temporary context, not inside
it. This creates a need to free that buffer explicitly when the temp
context is freed, but that was overlooked. In most cases, this is all
happening inside a portal or executor context that will go away shortly
anyhow, but that's not always true. Notably, the stringinfo ends up
getting leaked when JDBC uses row-at-a-time fetches. For a query
that returns wide rows, that adds up after awhile.
Per bug #15700 from Matthias Otterbach. Back-patch to v11 where the
faulty code was added.
Discussion: https://postgr.es/m/15700-8c408321a87d56bb@postgresql.org
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/adf27de8eabbf43b049d1a1bb72780e53e8ea863
Modified Files
--------------
src/backend/access/common/printtup.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2019-03-18 23:53:53 | pgsql: Fix error message in pg_verify_checksums |
Previous Message | Andres Freund | 2019-03-18 20:41:05 | pgsql: Fix typos in sgml docs about RefetchForeignRow(). |