pg_dump: Fix dangling pointer in EndCompressorZstd()

Alexander Kuznetsov <kuznetsovam@altlinux.org>

From: Alexander Kuznetsov <kuznetsovam@altlinux.org>
To: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Cc: egori@altlinux.org, nickel@altlinux.org
Date: 2025-04-16T08:27:37Z
Lists: pgsql-hackers

Attachments

Hello everyone,

We've found that EndCompressorZstd() doesn't set cs->private_data to NULL after pg_free(),
unlike other EndCompressor implementations.
While this doesn't currently cause issues (as the pointer soon gets reassigned),
we recommend fixing this to maintain consistency with other implementations and prevent potential future issues.

The patch is attached, would appreciate your thoughts on this change.

--
Best regards,
Alexander Kuznetsov

Commits

  1. pg_dump: Set private_date pointer to NULL in callback