Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3f06324

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

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)

[8]ページ先頭

©2009-2025 Movatter.jp