pgsql: Fix double assignment.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix double assignment.
Date: 2025-12-14 17:09:58
Message-ID: E1vUpbZ-000kiR-2u@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix double assignment.

Coverity complained about this, not without reason:

OldMultiXactReader *state = state = pg_malloc(sizeof(*state));

(I'm surprised this is even legal C ... why is "state" in-scope
in its initialization expression?)

While at it, convert to use our newly-preferred "pg_malloc_object"
macro instead of an explicit sizeof().

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b853e644d78d99ef1779c9bf7bc3944694460aa2

Modified Files
--------------
src/bin/pg_upgrade/multixact_read_v18.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-12-14 17:18:12 Re: pgsql: Add a regression test to verify that NLS translation works.
Previous Message Alexander Korotkov 2025-12-14 17:02:06 Re: pgsql: Add a regression test to verify that NLS translation works.