pgsql: Fix memory leaks in pg_combinebackup/reconstruct.c.

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 leaks in pg_combinebackup/reconstruct.c.
Date: 2025-10-22 17:38:58
Message-ID: E1vBcna-002yvz-1E@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix memory leaks in pg_combinebackup/reconstruct.c.

One code path forgot to free the separately-malloc'd filename
part of a struct rfile. Another place freed the filename but
forgot the struct rfile itself. These seem worth fixing because
with a large backup we could be dealing with many files.

Coverity found the bug in make_rfile(). I found the other one
by manual inspection.

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e2072b47b9abc7d298d242217919d3d0d9415fca

Modified Files
--------------
src/bin/pg_combinebackup/reconstruct.c | 2 ++
1 file changed, 2 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-10-22 19:19:27 pgsql: Fix memory leaks in scripts/vacuuming.c.
Previous Message Nathan Bossart 2025-10-22 17:32:49 pgsql: Remove make_temptable_name_n().