From: Tom Lane Date: Sun, 14 Dec 2025 17:09:56 +0000 (-0500) Subject: Fix double assignment. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;ds=sidebyside;p=postgresql.git 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(). --- diff --git a/src/bin/pg_upgrade/multixact_read_v18.c b/src/bin/pg_upgrade/multixact_read_v18.c index e7496a73e0e..f74011c4786 100644 --- a/src/bin/pg_upgrade/multixact_read_v18.c +++ b/src/bin/pg_upgrade/multixact_read_v18.c @@ -119,7 +119,7 @@ OldMultiXactReader * AllocOldMultiXactRead(char *pgdata, MultiXactId nextMulti, MultiXactOffset32 nextOffset) { - OldMultiXactReader *state = state = pg_malloc(sizeof(*state)); + OldMultiXactReader *state = pg_malloc_object(OldMultiXactReader); char dir[MAXPGPATH] = {0}; state->nextMXact = nextMulti;