- /* Command includes ID, we must use that. Also check whether the command
- has more than one ID set - take them all. */
-
- *client_id = silc_calloc(1, sizeof(**client_id));
- (*client_id)[0] = silc_id_payload_parse_id(tmp, len, NULL);
- if ((*client_id)[0] == NULL) {
- silc_free(*client_id);
- silc_server_command_send_status_reply(cmd, command,
- SILC_STATUS_ERR_NOT_ENOUGH_PARAMS);
- return FALSE;
- }
- *client_id_count = 1;
-
- /* Take all ID's from the command packet */
- if (argc > 1) {
- for (k = 1, i = 1; i < argc; i++) {
- tmp = silc_argument_get_arg_type(cmd->args, i + 3, &len);
- if (tmp) {
- *client_id = silc_realloc(*client_id, sizeof(**client_id) *
- (*client_id_count + 1));
- (*client_id)[k] = silc_id_payload_parse_id(tmp, len, NULL);
- if ((*client_id)[k] == NULL) {
- /* Cleanup all and fail */
- for (i = 0; i < *client_id_count; i++)
- silc_free((*client_id)[i]);
- silc_free(*client_id);
- silc_server_command_send_status_reply(
- cmd, command,
- SILC_STATUS_ERR_NOT_ENOUGH_PARAMS);
- return FALSE;
- }
- (*client_id_count)++;
- k++;
- }
+ /* Command includes ID, we must use that. Take all ID's from the
+ command packet */
+ for (k = 0, i = 0; i < argc; i++) {
+ tmp = silc_argument_get_arg_type(cmd->args, i + 3, &len);
+ if (!tmp)
+ continue;
+ id = silc_id_payload_parse_id(tmp, len, NULL);
+ if (id) {
+ *client_id = silc_realloc(*client_id, sizeof(**client_id) *
+ (*client_id_count + 1));
+ (*client_id)[k] = id;
+ (*client_id_count)++;
+ k++;
+ } else {
+ ADD_ERROR((*error_client), (*error_client_count), NULL, i + 3,
+ SILC_STATUS_ERR_BAD_CLIENT_ID);