SilcServer server = cmd->server;
SilcClientEntry client = (SilcClientEntry)cmd->sock->user_data;
SilcIDListData idata = (SilcIDListData)client;
- SilcChannelID *channel_id;
- SilcClientID *client_id;
+ SilcChannelID *channel_id = NULL;
+ SilcClientID *client_id = NULL;
SilcChannelEntry channel;
SilcClientEntry target_client;
SilcChannelClientEntry chl;
packet->data, packet->len, FALSE);
silc_buffer_free(packet);
- silc_free(channel_id);
- silc_free(client_id);
silc_buffer_free(idp);
out:
+ silc_free(channel_id);
+ silc_free(client_id);
silc_free(fkey);
silc_server_command_free(cmd);
}
if (!silc_idlist_del_client(server->local_list, client))
silc_idlist_del_client(server->global_list, client);
client = detached_client;
+ silc_free(client->servername);
+ client->servername = strdup(server->server_name);
/* If the ID is not based in our ID then change it */
if (!SILC_ID_COMPARE(client->id, server->id, server->id->ip.data_len)) {
for (i = 0; i < query->querylist_count; i++) {
r = &query->querylist[i];
+ /* If Requested Attributes were present put them to this resolving */
+ if (query->attrs && query->querycmd == SILC_COMMAND_WHOIS) {
+ len = r->argc + 1;
+ r->arg = silc_realloc(r->arg, sizeof(*r->arg) * len);
+ r->arg_lens = silc_realloc(r->arg_lens, sizeof(*r->arg_lens) * len);
+ r->arg_types = silc_realloc(r->arg_types, sizeof(*r->arg_types) * len);
+
+ tmp = silc_argument_get_arg_type(cmd->args, 3, &len);
+ if (tmp)
+ r->arg[r->argc] = silc_memdup(tmp, len);
+ r->arg_lens[r->argc] = len;
+ r->arg_types[r->argc] = 3;
+ r->argc++;
+ }
+
/* Send WHOIS command */
res_cmd = silc_command_payload_encode(SILC_COMMAND_WHOIS,
r->argc, r->arg, r->arg_lens,
case SILC_COMMAND_WHOIS:
case SILC_COMMAND_IDENTIFY:
/* Take existing query context if exist for this connection */
- for (i = 0; i < query->queries_count; i++)
+ for (i = 0; i < query->querylist_count; i++)
if (query->querylist[i].sock == sock) {
r = &query->querylist[i];
break;
r->timeout = 3;
}
- /* If Requested Attributes were present put them to this resolving */
- if (query->attrs && query->querycmd == SILC_COMMAND_WHOIS) {
- len = r->argc + 1;
- r->arg = silc_realloc(r->arg, sizeof(*r->arg) * len);
- r->arg_lens = silc_realloc(r->arg_lens, sizeof(*r->arg_lens) * len);
- r->arg_types = silc_realloc(r->arg_types, sizeof(*r->arg_types) * len);
-
- tmp = silc_argument_get_arg_type(cmd->args, 3, &len);
- if (tmp)
- r->arg[r->argc] = silc_memdup(tmp, len);
- r->arg_lens[r->argc] = len;
- r->arg_types[r->argc] = 3;
- r->argc++;
- }
-
len = r->argc + 1;
r->arg = silc_realloc(r->arg, sizeof(*r->arg) * len);
r->arg_lens = silc_realloc(r->arg_lens, sizeof(*r->arg_lens) * len);
attributes we will reply to them on behalf of the client. */
len = 0;
if (query->attrs) {
- if (!entry->attrs) {
+ if (!entry->attrs && SILC_IS_LOCAL(entry)) {
tmpattrs = silc_server_query_reply_attrs(server, query, entry);
entry->attrs = silc_memdup(tmpattrs->data, tmpattrs->len);
entry->attrs_len = tmpattrs->len;