mirror of https://github.com/ARMmbed/mbed-os.git
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.
pull/9066/head
parent
5f0912276b
commit
03853597f5
|
|
@ -601,7 +601,7 @@ static void equeue_chain_update(void *p, int ms)
|
|||
if (ms >= 0) {
|
||||
c->id = equeue_call_in(c->target, ms, equeue_chain_dispatch, c->q);
|
||||
} else {
|
||||
equeue_dealloc(c->target, c);
|
||||
equeue_dealloc(c->q, c);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue