)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"d45ce3418f37e86ea8914ce1d8de30fd2a08d2bb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"b8ef1d52_ddba8c41","updated":"2025-10-19 10:10:24.000000000","message":"I agree with you both. The leak is marginal so don\u0027t waste too much energy on it. For the moment we can keep the code as is.","commit_id":"78e0e1b20dfa2baa30c7fbc943f500c1e241a926"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"aff98f3940a9ed16fd16b7260e63f508762a2946","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"1a35b8b6_b1274720","updated":"2025-10-18 12:50:41.000000000","message":"Thanks for the fix.\n\nI prefer you don\u0027t use `atexit()` but you put the `free()` in the function `cmsis_dap_tcp_close()`.","commit_id":"78e0e1b20dfa2baa30c7fbc943f500c1e241a926"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"61898536f38447b990a4628fb491457106f6c3e1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"1b727732_62f9ad6e","updated":"2025-10-19 09:59:21.000000000","message":"wrongly deleted myself from the reviewers! I put again -1 to check if I reappear there","commit_id":"78e0e1b20dfa2baa30c7fbc943f500c1e241a926"},{"author":{"_account_id":1002413,"name":"Brian Kuschak","email":"bkuschak@gmail.com","username":"bkuschak"},"change_message_id":"67578940e6b0dbd4b994fac9f0771206d8e771f4","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7bcff04c_4a332f14","in_reply_to":"1a35b8b6_b1274720","updated":"2025-10-18 22:19:00.000000000","message":"Honestly I don\u0027t really like it either, but it\u0027s the only way I\u0027ve found to guarantee the memory is freed in all cases. If the adapter initialization fails, the close() is not called, and the leak remains. It seems like that is an architectural issue, and a larger issue than I want to tackle in this patch. In light of that, I\u0027m inclined to think this is a reasonable workaround for now.","commit_id":"78e0e1b20dfa2baa30c7fbc943f500c1e241a926"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"bbf459dd0f32b4eed9a110ebd04f49f2c07b5a57","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d9d7a81a_e3f3eb71","in_reply_to":"7bcff04c_4a332f14","updated":"2025-10-19 09:58:07.000000000","message":"Indeed, it\u0027s an architectural issue and the same problem is present for almost all the adapters.\n\nRegarding this cmsis-dap, the function `cmsis_dap_init()` calls `cmsis_dap_quit()` that runs the `free()`, but only if it already connected to the adapter.\nProbably `cmsis_dap_init()` could be improved to call `cmsis_dap_quit()` in every case of failure.\nBut, architectural issue, it will still leak if command `shutdown` is called before `init`, e.g.:\n`openocd -f interface/cmsis-dap.cfg -c \u0027cmsis-dap tcp host dummy; shutdown\u0027`\nI think this case can be left out, for the moment, as it need deeper fix.","commit_id":"78e0e1b20dfa2baa30c7fbc943f500c1e241a926"}]}
