pg_upgrade: Fix memory leak in check_for_unicode_update().

Nathan Bossart <nathan@postgresql.org>

Commit: de48056ec7d237e6a48dce907804ac26c87311ec
Author: Nathan Bossart <nathan@postgresql.org>
Date: 2025-04-06T20:11:41Z
Releases: 18.0
pg_upgrade: Fix memory leak in check_for_unicode_update().

This function was initializing the "task" variable before a couple
of early returns.  To fix, postpone the initialization until just
before it's needed.

Per Coverity.

Discussion: https://postgr.es/m/Z_KMsUH2-FEbiNjC%40nathan

Files

PathChange+/−
src/bin/pg_upgrade/check.c modified +2 −1

Discussion