From 64ac25c026800840b88c014374899b04e8a44e43 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 7 May 2005 18:14:25 +0000 Subject: [PATCH] Fix case in which a debug printout would print already-pfreed data. --- src/backend/access/transam/multixact.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c index daf86187c6..bbadd7d41e 100644 --- a/src/backend/access/transam/multixact.c +++ b/src/backend/access/transam/multixact.c @@ -310,9 +310,9 @@ MultiXactIdExpand(MultiXactId multi, TransactionId xid) { if (TransactionIdEquals(members[i], xid)) { - pfree(members); debug_elog4(DEBUG2, "Expand: %u is already a member of %u", xid, multi); + pfree(members); return multi; } } @@ -376,8 +376,8 @@ MultiXactIdIsRunning(MultiXactId multi) { if (TransactionIdEquals(members[i], myXid)) { - pfree(members); debug_elog3(DEBUG2, "IsRunning: I (%d) am running!", i); + pfree(members); return true; } } @@ -391,14 +391,15 @@ MultiXactIdIsRunning(MultiXactId multi) { if (TransactionIdIsInProgress(members[i])) { - pfree(members); debug_elog4(DEBUG2, "IsRunning: member %d (%u) is running", - i, members[i]); + i, members[i]); + pfree(members); return true; } } pfree(members); + debug_elog3(DEBUG2, "IsRunning: %u is not running", multi); return false; @@ -646,6 +647,7 @@ CreateMultiXactId(int nxids, TransactionId *xids) /* Store the new MultiXactId in the local cache, too */ mXactCachePut(multi, nxids, xids); + debug_elog2(DEBUG2, "Create: all done"); return multi; -- 2.39.5