Use after free detected in toolkit_test_server_file_transfer (toolkit_demo_file_transfer and pubsub_server)
=================================================================
==877==ERROR: AddressSanitizer: heap-use-after-free on address 0x61d0000026f2 at pc 0x00000053cfa6 bp 0x7fa3027fb9f0 sp 0x7fa3027fb9e8
READ of size 2 at 0x61d0000026f2 thread T4
#0 0x53cfa5 in SOPC_SecureConnectionStateMgr_OnInternalEvent /builds/produit/s2opc/S2OPC/src/ClientServer/secure_channels/sopc_secure_connection_state_mgr.c:2864
#1 0x675b7a in looper_loop /builds/produit/s2opc/S2OPC/src/Common/helpers/sopc_event_handler.c:108
#2 0x7fa307964ea6 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7ea6)
#3 0x7fa307715a2e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xfba2e)
0x61d0000026f2 is located 2162 bytes inside of 2248-byte region [0x61d000001e80,0x61d000002748)
freed by thread T0 here:
#0 0x4a3307 in __interceptor_free (/builds/produit/s2opc/S2OPC/build/bin/toolkit_test_server_file_transfer+0x4a3307)
#1 0x505896 in SOPC_ServerConfigHelper_Clear /builds/produit/s2opc/S2OPC/src/ClientServer/frontend/server_wrapper/libs2opc_server_config.c:532
#2 0x505896 in SOPC_ServerConfigHelper_Clear /builds/produit/s2opc/S2OPC/src/ClientServer/frontend/server_wrapper/libs2opc_server_config.c:514
#3 0x4ee606 in SOPC_FileTransfer_Clear /builds/produit/s2opc/S2OPC/samples/ClientServer/demo_file_transfer/sopc_file_transfer.c:1146
#4 0x417c67 in main /builds/produit/s2opc/S2OPC/tests/ClientServer/validation_tests/server/toolkit_test_server_file_transfer.c:224
#5 0x7fa30763dd09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09)
previously allocated by thread T0 here:
#0 0x4a37b7 in __interceptor_calloc (/builds/produit/s2opc/S2OPC/build/bin/toolkit_test_server_file_transfer+0x4a37b7)
#1 0x5130b4 in SOPC_ServerConfigHelper_ConfigureFromXML /builds/produit/s2opc/S2OPC/src/ClientServer/frontend/server_wrapper/libs2opc_server_config_xml.c:229
#2 0x4176c8 in Server_LoadServerConfigurationFromPaths /builds/produit/s2opc/S2OPC/tests/ClientServer/validation_tests/server/toolkit_test_server_file_transfer.c:82
#3 0x4176c8 in main /builds/produit/s2opc/S2OPC/tests/ClientServer/validation_tests/server/toolkit_test_server_file_transfer.c:158
#4 0x7fa30763dd09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09)
Thread T4 created by T0 here:
#0 0x44b5d6 in __interceptor_pthread_create (/builds/produit/s2opc/S2OPC/build/bin/toolkit_test_server_file_transfer+0x44b5d6)
#1 0x66a602 in create_thread /builds/produit/s2opc/S2OPC/src/Common/helpers_platform_dep/linux/p_sopc_threads.c:246
#2 0x66a602 in SOPC_Thread_Create /builds/produit/s2opc/S2OPC/src/Common/helpers_platform_dep/linux/p_sopc_threads.c:286
#3 0x676899 in SOPC_Looper_Create /builds/produit/s2opc/S2OPC/src/Common/helpers/sopc_event_handler.c:162
#4 0x526d7e in SOPC_SecureChannelsInternalContext_Initialize /builds/produit/s2opc/S2OPC/src/ClientServer/secure_channels/sopc_secure_channels_internal_ctx.c:47
#5 0x522775 in SOPC_Toolkit_Initialize /builds/produit/s2opc/S2OPC/src/ClientServer/configuration/sopc_toolkit_config.c:122
#6 0x4f216b in SOPC_CommonHelper_Initialize /builds/produit/s2opc/S2OPC/src/ClientServer/frontend/common_wrapper/libs2opc_common_config.c:131
#7 0x417667 in main /builds/produit/s2opc/S2OPC/tests/ClientServer/validation_tests/server/toolkit_test_server_file_transfer.c:146
#8 0x7fa30763dd09 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x23d09)
See attached file for details.