Memory leak in MQX 4.2 timer.c

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Memory leak in MQX 4.2 timer.c

Jump to solution
934 Views
fcw
Contributor IV

Line 417 states "timer_entry_ptr = (TIMER_ENTRY_STRUCT_PTR)_mem_alloc_system_zero(  ......."

Then lines 448 and following state:

        "if (_lwsem_wait(&timer_component_ptr->TIMER_ENTRIES_LWSEM) != MQX_OK)
        {
            _task_set_error(MQX_INVALID_LWSEM);
            return(TIMER_NULL_ID);
        }"

... thus exiting without freeing timer_entry_ptr.

Tags (2)
0 Kudos
Reply
1 Solution
729 Views
EAI
Contributor IV

Fred;

You are correct. This same error also occurs elsewhere in the file (on each of the _timer_start_..._internal functions). The timer code has been refactored for MQXv5, and this has been fixed.

Craig

View solution in original post

0 Kudos
Reply
2 Replies
730 Views
EAI
Contributor IV

Fred;

You are correct. This same error also occurs elsewhere in the file (on each of the _timer_start_..._internal functions). The timer code has been refactored for MQXv5, and this has been fixed.

Craig

0 Kudos
Reply
729 Views
fcw
Contributor IV

OK, great, but what about a fix for 4.2?

0 Kudos
Reply