}
}
- reg_packet = malloc(DIV_ROUND_UP(reg_list[reg_num]->size, 8) * 2 + 1); /* plus one for string termination null */
+ reg_packet = calloc(DIV_ROUND_UP(reg_list[reg_num]->size, 8) * 2 + 1, 1); /* plus one for string termination null */
gdb_str_to_target(target, reg_packet, reg_list[reg_num]);
target->gdb_service = gdb_service;
ret = add_service("gdb",
- port, 1, &gdb_new_connection, &gdb_input,
- &gdb_connection_closed, gdb_service);
+ port, target->gdb_max_connections, &gdb_new_connection, &gdb_input,
+ &gdb_connection_closed, gdb_service, NULL);
/* initialize all targets gdb service with the same pointer */
{
struct target_list *head;