]> granicus.if.org Git - postgresql/commitdiff
Fix seriously nasty memory leak in new TransactionIdIsInProgress code.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 1 Jul 2004 03:13:05 +0000 (03:13 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 1 Jul 2004 03:13:05 +0000 (03:13 +0000)
src/backend/storage/ipc/sinval.c

index bf4eb0f6293b60d80ab7a1c7b1edea000e1d6167..f5e909c672c5eb63446f228bbe20b899ea7ed3bd 100644 (file)
@@ -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;
 }