Skip to content

Commit 0385359

Browse files
author
deepikabhavnani
committed
Memory allocated from parent queue was freed/added to chained queue.
Issue was seen with below example EventQueue q1; EventQueue q2; void main() { while( true ) { q1.chain( &q2 ); // Chain q2 to q1 q1.chain( NULL ); // Remove chain from q1 //This second step should free the memory from the chained q2 event. } } Memory allocated from q1 slab was freed for q2, which will result in memory leak.
1 parent 5f09122 commit 0385359

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

events/equeue/equeue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ static void equeue_chain_update(void *p, int ms)
601601
if (ms >= 0) {
602602
c->id = equeue_call_in(c->target, ms, equeue_chain_dispatch, c->q);
603603
} else {
604-
equeue_dealloc(c->target, c);
604+
equeue_dealloc(c->q, c);
605605
}
606606
}
607607

0 commit comments

Comments
 (0)