|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.31 2001/05/18 21:24:20 momjian Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.32 2001/06/01 20:07:16 tgl Exp $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
@@ -283,15 +283,24 @@ GetSnapshotData(bool serializable) |
283 | 283 | intindex; |
284 | 284 | intcount=0; |
285 | 285 |
|
| 286 | +if (snapshot==NULL) |
| 287 | +elog(ERROR,"Memory exhausted in GetSnapshotData"); |
| 288 | + |
| 289 | +snapshot->xmin=GetCurrentTransactionId(); |
| 290 | + |
| 291 | +SpinAcquire(SInvalLock); |
| 292 | + |
286 | 293 | /* |
287 | 294 | * There can be no more than lastBackend active transactions, so this |
288 | 295 | * is enough space: |
289 | 296 | */ |
290 | 297 | snapshot->xip= (TransactionId*) |
291 | 298 | malloc(segP->lastBackend*sizeof(TransactionId)); |
292 | | -snapshot->xmin=GetCurrentTransactionId(); |
293 | | - |
294 | | -SpinAcquire(SInvalLock); |
| 299 | +if (snapshot->xip==NULL) |
| 300 | +{ |
| 301 | +SpinRelease(SInvalLock); |
| 302 | +elog(ERROR,"Memory exhausted in GetSnapshotData"); |
| 303 | +} |
295 | 304 |
|
296 | 305 | /* |
297 | 306 | * Unfortunately, we have to call ReadNewTransactionId() after |
|