Skip to content

Commit cc1b915

Browse files
authored
Merge pull request #14 from postgrespro/pp5692
ee: Use memory context instead of malloc in ATX handling
2 parents 0d9e756 + fdb4d41 commit cc1b915

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/multimaster.c

Lines changed: 2 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy