diff options
author | Daniel Gustafsson <dgustafsson@postgresql.org> | 2025-04-17 12:58:00 +0200 |
---|---|---|
committer | Daniel Gustafsson <dgustafsson@postgresql.org> | 2025-04-17 12:58:00 +0200 |
commit | b669293e3432ee8fdcd44854a945837bb18eea5c (patch) | |
tree | 75e854d9c1b42217fc581cee6bd226d2779389f6 | |
parent | e4b0f86e1fe38147b0bcf6e50862d0899a31201c (diff) | |
download | postgresql-b669293e3432ee8fdcd44854a945837bb18eea5c.tar.gz postgresql-b669293e3432ee8fdcd44854a945837bb18eea5c.zip |
pg_dump: Set private_date pointer to NULL in callback
The end callback for ZStandard compression frees the private_data
but didn't set the pointer to NULL after freeing. This is not a
bug as the code is right now, since nothing is dereferencing the
pointer upon returning from the callback but it is good practice
to do.
Author: Alexander Kuznetsov <kuznetsovam@altlinux.org>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/efaee52b-9550-44ca-8633-ea86076b3283@altlinux.org
-rw-r--r-- | src/bin/pg_dump/compress_zstd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bin/pg_dump/compress_zstd.c b/src/bin/pg_dump/compress_zstd.c index 1f7b4942706..cb595b10c2d 100644 --- a/src/bin/pg_dump/compress_zstd.c +++ b/src/bin/pg_dump/compress_zstd.c @@ -142,6 +142,7 @@ EndCompressorZstd(ArchiveHandle *AH, CompressorState *cs) /* output buffer may be allocated in either mode */ pg_free(zstdcs->output.dst); pg_free(zstdcs); + cs->private_data = NULL; } static void |