flash/stmqspi: minor fixes on coding style
[fw/openocd] / src / server / gdb_server.c
index c369665547f14c545a832c824fea5b87a23759d0..bb4c1317de90ff5a4f0296640bfb188deff0bc42 100644 (file)
@@ -1332,7 +1332,7 @@ static int gdb_get_register_packet(struct connection *connection,
                }
        }
 
-       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]);
 
@@ -3508,8 +3508,8 @@ static int gdb_target_start(struct target *target, const char *port)
        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;