pgsql: Fix a memory leak in dumping functions with TRANSFORMs

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix a memory leak in dumping functions with TRANSFORMs
Date: 2024-12-11 11:50:28
Message-ID: E1tLLEZ-002BeK-PT@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix a memory leak in dumping functions with TRANSFORMs

The gneration of the dump clause for functions with TRANSFORM
calls would leak the memory for holding the result of the Oid
array parsing. Fix by freeing.

While in there, switch to using pg_malloc instead of palloc in
order to be consistent with the rest of the file.

Author: Oleg Tselebrovskiy <o(dot)tselebrovskiy(at)postgrespro(dot)ru>
Reviewed-by: Daniel Gustafsson <daniel(at)yesql(dot)se>
Discussion: https://postgr.es/m/baf1ae4511288e5b421f41e79a3df1a0@postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0e033f5b6de569e712d5f94b77878b8ffacf6397

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2024-12-11 18:36:46 pgsql: Unmark gen_random_uuid() function leakproof.
Previous Message David Rowley 2024-12-11 10:17:07 pgsql: Add missing BUFFERS OFF in regression tests, take 2