)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"78cbf137b5ad0dece88c574bd3049e513aafd01b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"60794562_30b9bf1c","updated":"2023-12-17 18:00:26.000000000","message":"some minor comment below","commit_id":"fccf08e79c148dd320c4e75cedd20583191d085b"},{"author":{"_account_id":1001810,"name":"Daniel Anselmi","email":"danselmi@gmx.ch","username":"danselmi"},"change_message_id":"91f9a5652165819fe71228d2b4539a2802975132","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"9f7512f2_7985469e","updated":"2023-12-18 20:18:52.000000000","message":"Thanks Antonio!","commit_id":"7a8c26c91d3013bbdba26598404e6bb18fd16ae4"}],"src/server/ipdbg.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"78cbf137b5ad0dece88c574bd3049e513aafd01b","unresolved":true,"context_lines":[{"line_number":252,"context_line":"\t\tgoto mem_err1;"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"\tconst size_t dreg_buffer_size \u003d DIV_ROUND_UP(data_register_length, 8);"},{"line_number":255,"context_line":"\tnew_hub-\u003escratch_memory.dr_out_vals \u003d calloc(IPDBG_SCRATCH_MEMORY_SIZE, dreg_buffer_size);"},{"line_number":256,"context_line":"\tif (!new_hub-\u003escratch_memory.dr_out_vals)"},{"line_number":257,"context_line":"\t\tgoto mem_err2;"},{"line_number":258,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"44830d97_f62800a9","line":255,"updated":"2023-12-17 18:00:26.000000000","message":"since new_hub is allocated through calloc() that zeroes the memory, and since free(NULL) is allowed, you can simplify this code dropping some label:\nnew_hub-\u003escratch_memory.dr_out_vals \u003d calloc(..);\nnew_hub-\u003escratch_memory.dr_in_vals \u003d calloc(..);\n...\nif (!this || !that || !and_so_on)\n  goto mem_err2;\n\nand you put below together most of the free()\nmem_err2:\nfree(new_hub-\u003escratch_memory.vir_out_val);\nfree(new_hub-\u003escratch_memory.fields);\nfree(new_hub-\u003escratch_memory.dr_in_vals);\nfree(new_hub-\u003escratch_memory.dr_out_vals);\nfree(new_hub);\nmem_err1:","commit_id":"fccf08e79c148dd320c4e75cedd20583191d085b"},{"author":{"_account_id":1001810,"name":"Daniel Anselmi","email":"danselmi@gmx.ch","username":"danselmi"},"change_message_id":"91f9a5652165819fe71228d2b4539a2802975132","unresolved":false,"context_lines":[{"line_number":252,"context_line":"\t\tgoto mem_err1;"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"\tconst size_t dreg_buffer_size \u003d DIV_ROUND_UP(data_register_length, 8);"},{"line_number":255,"context_line":"\tnew_hub-\u003escratch_memory.dr_out_vals \u003d calloc(IPDBG_SCRATCH_MEMORY_SIZE, dreg_buffer_size);"},{"line_number":256,"context_line":"\tif (!new_hub-\u003escratch_memory.dr_out_vals)"},{"line_number":257,"context_line":"\t\tgoto mem_err2;"},{"line_number":258,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"6c450731_713fb16c","line":255,"in_reply_to":"44830d97_f62800a9","updated":"2023-12-18 20:18:52.000000000","message":"Done","commit_id":"fccf08e79c148dd320c4e75cedd20583191d085b"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"78cbf137b5ad0dece88c574bd3049e513aafd01b","unresolved":true,"context_lines":[{"line_number":469,"context_line":"\tif (!tap)"},{"line_number":470,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"#if IPDBG_SCRATCH_MEMORY_SIZE \u003c IPDBG_EMPTY_DOWN_TRANSFERS"},{"line_number":473,"context_line":"#error \"scratch Memory must be at least IPDBG_EMPTY_DOWN_TRANSFERS\""},{"line_number":474,"context_line":"#endif"},{"line_number":475,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"f722e426_68405201","line":472,"updated":"2023-12-17 18:00:26.000000000","message":"please move this on top of this file, immediately after the define for these two macros","commit_id":"fccf08e79c148dd320c4e75cedd20583191d085b"},{"author":{"_account_id":1001810,"name":"Daniel Anselmi","email":"danselmi@gmx.ch","username":"danselmi"},"change_message_id":"91f9a5652165819fe71228d2b4539a2802975132","unresolved":false,"context_lines":[{"line_number":469,"context_line":"\tif (!tap)"},{"line_number":470,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"#if IPDBG_SCRATCH_MEMORY_SIZE \u003c IPDBG_EMPTY_DOWN_TRANSFERS"},{"line_number":473,"context_line":"#error \"scratch Memory must be at least IPDBG_EMPTY_DOWN_TRANSFERS\""},{"line_number":474,"context_line":"#endif"},{"line_number":475,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"75394fd2_33fdc8e4","line":472,"in_reply_to":"f722e426_68405201","updated":"2023-12-18 20:18:52.000000000","message":"Done","commit_id":"fccf08e79c148dd320c4e75cedd20583191d085b"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"78cbf137b5ad0dece88c574bd3049e513aafd01b","unresolved":true,"context_lines":[{"line_number":535,"context_line":"\tif (!tap)"},{"line_number":536,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"#if IPDBG_SCRATCH_MEMORY_SIZE \u003c IPDBG_CONSECUTIVE_UP_TRANSFERS"},{"line_number":539,"context_line":"#error \"scratch Memory must be at least IPDBG_CONSECUTIVE_UP_TRANSFERS\""},{"line_number":540,"context_line":"#endif"},{"line_number":541,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"5c6eb008_70be7716","line":538,"updated":"2023-12-17 18:00:26.000000000","message":"and move this too","commit_id":"fccf08e79c148dd320c4e75cedd20583191d085b"},{"author":{"_account_id":1001810,"name":"Daniel Anselmi","email":"danselmi@gmx.ch","username":"danselmi"},"change_message_id":"91f9a5652165819fe71228d2b4539a2802975132","unresolved":false,"context_lines":[{"line_number":535,"context_line":"\tif (!tap)"},{"line_number":536,"context_line":"\t\treturn ERROR_FAIL;"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"#if IPDBG_SCRATCH_MEMORY_SIZE \u003c IPDBG_CONSECUTIVE_UP_TRANSFERS"},{"line_number":539,"context_line":"#error \"scratch Memory must be at least IPDBG_CONSECUTIVE_UP_TRANSFERS\""},{"line_number":540,"context_line":"#endif"},{"line_number":541,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":2,"id":"164bff2b_418716a0","line":538,"in_reply_to":"5c6eb008_70be7716","updated":"2023-12-18 20:18:52.000000000","message":"Done","commit_id":"fccf08e79c148dd320c4e75cedd20583191d085b"}]}
