1
0
mirror of https://github.com/postgres/postgres.git synced 2026-01-26 09:41:40 +03:00

pg_dump: Fix memory leak in dumpSequenceData().

Oversight in commit 7a485bd641.  Per Coverity.

Backpatch-through: 18
This commit is contained in:
Nathan Bossart
2026-01-11 13:52:50 -06:00
parent 540c39cc56
commit 5d1f5079ab

View File

@@ -19230,12 +19230,14 @@ dumpSequenceData(Archive *fout, const TableDataInfo *tdinfo)
TableInfo *tbinfo = tdinfo->tdtable;
int64 last;
bool called;
PQExpBuffer query = createPQExpBuffer();
PQExpBuffer query;
/* needn't bother if not dumping sequence data */
if (!fout->dopt->dumpData && !fout->dopt->sequence_data)
return;
query = createPQExpBuffer();
/*
* For versions >= 18, the sequence information is gathered in the sorted
* array before any calls to dumpSequenceData(). See collectSequences()