summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2025-12-14 17:09:56 +0000
committerTom Lane2025-12-14 17:09:56 +0000
commitb853e644d78d99ef1779c9bf7bc3944694460aa2 (patch)
tree34abfbbbdbec586d224286b77af3f07f1b2c80a1
parent8c498479d70f963533d57d8bb1b3a58e00fe0d03 (diff)
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().
-rw-r--r--src/bin/pg_upgrade/multixact_read_v18.c2
1 files changed, 1 insertions, 1 deletions
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;