Memory leak in MQX 4.2 timer.c

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Memory leak in MQX 4.2 timer.c

ソリューションへジャンプ
883件の閲覧回数
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 解決策
678件の閲覧回数
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 返答(返信)
679件の閲覧回数
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 件の賞賛
678件の閲覧回数
fcw
Contributor IV

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

0 件の賞賛