mirror of
https://github.com/postgres/postgres.git
synced 2025-12-18 05:01:01 +03:00
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().
This commit is contained in:
@@ -119,7 +119,7 @@ OldMultiXactReader *
|
|||||||
AllocOldMultiXactRead(char *pgdata, MultiXactId nextMulti,
|
AllocOldMultiXactRead(char *pgdata, MultiXactId nextMulti,
|
||||||
MultiXactOffset32 nextOffset)
|
MultiXactOffset32 nextOffset)
|
||||||
{
|
{
|
||||||
OldMultiXactReader *state = state = pg_malloc(sizeof(*state));
|
OldMultiXactReader *state = pg_malloc_object(OldMultiXactReader);
|
||||||
char dir[MAXPGPATH] = {0};
|
char dir[MAXPGPATH] = {0};
|
||||||
|
|
||||||
state->nextMXact = nextMulti;
|
state->nextMXact = nextMulti;
|
||||||
|
|||||||
Reference in New Issue
Block a user