Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fdb4d41

Browse files
committed
ee: Use memory context instead of malloc in ATX handling
PGPRO-5692 / PGPRO-5336
1 parent 3ad0c98 commit fdb4d41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/multimaster.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ MtmDeserializeTransactionState(void *ctx)
366366
static void *
367367
MtmSuspendTransaction(void)
368368
{
369-
MtmCurrentTrans *ctx = malloc(sizeof(MtmCurrentTrans));
369+
MtmCurrentTrans *ctx = MemoryContextAlloc(CurTransactionContext, sizeof(MtmCurrentTrans));
370370

371371
*ctx = MtmTx;
372372
return ctx;
@@ -376,7 +376,7 @@ static void
376376
MtmResumeTransaction(void *ctx)
377377
{
378378
MtmTx = *(MtmCurrentTrans *) ctx;
379-
free(ctx);
379+
pfree(ctx);
380380
}
381381
#endif
382382

0 commit comments

Comments
 (0)