You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, The Valgrind reported one definitely loss in the prv_getParameters() for version information allocation.
This function has big burden to free the memory for each exit port. We would suggest to use a label in the function and all exit must go to the label. That will easy manage the memory free situations.
==22838== 8 bytes in 2 blocks are definitely lost in loss record 12 of 246
==22838== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22838== by 0xE3D5EB5: lwm2m_malloc (platform.c:28)
==22838== by 0xE3CAB8E: prv_getParameters (registration.c:670)
==22838== by 0xE3CB990: registration_handleRequest (registration.c:1061)
==22838== by 0xE3C935F: handle_request (packet.c:172)
==22838== by 0xE3C9634: lwm2m_handle_packet (packet.c:299)
==22838== by 0xE3C0765: thread_lwm2m (lwm2mserver.c:237)
==22838== by 0x506A9FD: ThreadWrapper (in /media/beihai/WangXin-Fun/ssg-sto-crtl-iot-idrm/plugin-sdk/azure_base/host/lib/azure_iot_gateway_sdk-1.0.6/libgateway.so)
==22838== by 0x584D6B9: start_thread (pthread_create.c:333)
I have reported this as well in #368.
And my solution would actually be to move the codebase to c++ (#369). It is just too hard to get object lifetime right in C and also maintain a correct code, while accepting contributions from external people with different backgrounds and knowledge of the code.
Hi, The Valgrind reported one definitely loss in the prv_getParameters() for version information allocation.
This function has big burden to free the memory for each exit port. We would suggest to use a label in the function and all exit must go to the label. That will easy manage the memory free situations.
==22838== 8 bytes in 2 blocks are definitely lost in loss record 12 of 246
==22838== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22838== by 0xE3D5EB5: lwm2m_malloc (platform.c:28)
==22838== by 0xE3CAB8E: prv_getParameters (registration.c:670)
==22838== by 0xE3CB990: registration_handleRequest (registration.c:1061)
==22838== by 0xE3C935F: handle_request (packet.c:172)
==22838== by 0xE3C9634: lwm2m_handle_packet (packet.c:299)
==22838== by 0xE3C0765: thread_lwm2m (lwm2mserver.c:237)
==22838== by 0x506A9FD: ThreadWrapper (in /media/beihai/WangXin-Fun/ssg-sto-crtl-iot-idrm/plugin-sdk/azure_base/host/lib/azure_iot_gateway_sdk-1.0.6/libgateway.so)
==22838== by 0x584D6B9: start_thread (pthread_create.c:333)
The text was updated successfully, but these errors were encountered: