Memory leak in MQX 4.2 timer.c

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Memory leak in MQX 4.2 timer.c

跳至解决方案
861 次查看
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.

标记 (2)
0 项奖励
1 解答
656 次查看
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 项奖励
2 回复数
657 次查看
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 项奖励
656 次查看
fcw
Contributor IV

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

0 项奖励