Skip to content

Commit 0698eae

Browse files
rasifrmason-sharp
authored andcommitted
Fix memory leak and assertion bug
- Fix assertion in spock_worker.c Changed 'Assert(MySpockWorker->proc = MyProc)' to use '==' - Fix memory leak in spock_apply_heap.c Free remotetuple after reporting conflict
1 parent e74fb66 commit 0698eae

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/spock_apply_heap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,7 @@ spock_apply_heap_delete(SpockRelation *rel, SpockTupleData *oldtup)
12031203
remotetuple, NULL, SpockResolution_Skip,
12041204
InvalidTransactionId, false, InvalidRepOriginId,
12051205
(TimestampTz) 0, edata->targetRel->idxoid);
1206+
heap_freetuple(remotetuple);
12061207
}
12071208

12081209
/* Cleanup. */

src/spock_worker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ spock_worker_detach(bool crash)
427427

428428
LWLockAcquire(SpockCtx->lock, LW_EXCLUSIVE);
429429

430-
Assert(MySpockWorker->proc = MyProc);
430+
Assert(MySpockWorker->proc == MyProc);
431431
Assert(MySpockWorker->generation == MySpockWorkerGeneration);
432432
MySpockWorker->proc = NULL;
433433

0 commit comments

Comments
 (0)