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

Commit ab441db

Browse files
knizhnikkelvich
authored andcommitted
Fix dangling pointer access
1 parent a4bddc7 commit ab441db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pglogical_apply.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ process_remote_commit(StringInfo in)
662662
case PGLOGICAL_PREPARE:
663663
{
664664
Assert(IsTransactionState() && TransactionIdIsValid(MtmGetCurrentTransactionId()));
665-
gid = pq_getmsgstring(in);
665+
gid = pstrdup(pq_getmsgstring(in)); /* in case of spilling large transaction to the file, message body will be deallocated, so copy it */
666666
if (MtmExchangeGlobalTransactionStatus(gid, TRANSACTION_STATUS_IN_PROGRESS) == TRANSACTION_STATUS_ABORTED) {
667667
MTM_LOG1("Avoid prepare of previously aborted global transaction %s", gid);
668668
AbortCurrentTransaction();

0 commit comments

Comments
 (0)