diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-07-01 03:13:05 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-07-01 03:13:05 +0000 |
commit | 77a436ba55de1bb72df264e54db05873acf43c74 (patch) | |
tree | e28298e3e31f84f6290f20d4a83b4b8fa2bb19a1 /src | |
parent | 573a71a5da70d6e2503c8f53e3b4f26b3b6d738d (diff) | |
download | postgresql-77a436ba55de1bb72df264e54db05873acf43c74.tar.gz postgresql-77a436ba55de1bb72df264e54db05873acf43c74.zip |
Fix seriously nasty memory leak in new TransactionIdIsInProgress code.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/storage/ipc/sinval.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/backend/storage/ipc/sinval.c b/src/backend/storage/ipc/sinval.c index bf4eb0f6293..f5e909c672c 100644 --- a/src/backend/storage/ipc/sinval.c +++ b/src/backend/storage/ipc/sinval.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.65 2004/07/01 00:50:52 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.66 2004/07/01 03:13:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -509,7 +509,6 @@ TransactionIdIsInProgress(TransactionId xid) if (result) break; - } } @@ -531,12 +530,18 @@ TransactionIdIsInProgress(TransactionId xid) * We don't care if it aborted, because if it did, we won't find * it in the array. */ - for (i = 0; i < nxids; i++) + { if (TransactionIdEquals(xids[i], xid)) - return true; + { + result = true; + break; + } + } } + pfree(xids); + return result; } |