Open
ummu_mapt_create leaks initialized mutex on failure paths #9
dtwAdd on May 28
May 28 Added label: sig/sig-UnifiedBus
openeuler-ci-bot
May 28 Comments:
May 28 Comments:
Welcome To openEuler Community
Hey @udhdbaa , thanks for your contribution to the community.
Bot Usage Manual
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.
Contact Guide
If you have any questions, please contact the SIG: sig-UnifiedBus ,
and any of the maintainers: @hanjunguo, @jerry_lilijun, @liliang_euler, @linyunsheng, @will_niutao ,
and any of the committers: @Tankll2021, @fangfeng123 .


May 28 Associated pull request
Summary
ummu_mapt_create()allocatesmapt_info, initializesmapt_mutex, and then continues with queue/table setup.Problem
If
ummu_queue_create()or the later map initialization path fails, the function jumps toerr_queue_createand freesmapt_infodirectly.At that point
mapt_mutexhas already been initialized inummu_alloc_mapt_mem(), so the error path drops the object without callingpthread_mutex_destroy().Reproduction
ummu_alloc_mapt_mem()succeed.ummu_queue_create()orummu_mapt_table_ctx_init()fail.err_queue_createpath inummu_mapt_create().mapt_infois freed while its initialized mutex is still live.Expected
Failure cleanup should destroy
mapt_mutexbefore freeingmapt_info.Actual
The initialized mutex is leaked on the create failure path.