Content-Length: 261469 | pFad | http://github.com/postgrespro/postgres/commit/3f06324705aeb5a4c67b6c08f2016c4c3c756723

0E Fix memory leak in pg_restore with zstd-compressed data. · postgrespro/postgres@3f06324 · GitHub
Skip to content

Commit 3f06324

Browse files
committed
Fix memory leak in pg_restore with zstd-compressed data.
EndCompressorZstd() neglected to free everything. This was most visible with a lot of large objects in the dump. Per report from Tomasz Szypowski. Back-patch to v16 where this code came in. Discussion: https://postgr.es/m/DU0PR04MB94193D038A128EF989F922D199042@DU0PR04MB9419.eurprd04.prod.outlook.com
1 parent d96d1d5 commit 3f06324

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/pg_dump/compress_zstd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,10 @@ EndCompressorZstd(ArchiveHandle *AH, CompressorState *cs)
137137
Assert(zstdcs->dstream == NULL);
138138
_ZstdWriteCommon(AH, cs, true);
139139
ZSTD_freeCStream(zstdcs->cstream);
140-
pg_free(zstdcs->output.dst);
141140
}
142141

142+
/* output buffer may be allocated in either mode */
143+
pg_free(zstdcs->output.dst);
143144
pg_free(zstdcs);
144145
}
145146

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/3f06324705aeb5a4c67b6c08f2016c4c3c756723

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy