SilcIDCacheList list = NULL;
SilcClientEntry entry, *clients;
int i = 0;
+ bool found = FALSE;
/* Find ID from cache */
if (!silc_idcache_find_by_name(conn->client_cache, nickname, &list))
silc_idcache_list_first(list, &id_cache);
while (id_cache) {
clients[i++] = id_cache->context;
+ found = TRUE;
if (!silc_idcache_list_next(list, &id_cache))
break;
}
}
clients[i++] = id_cache->context;
+ found = TRUE;
if (!silc_idcache_list_next(list, &id_cache))
break;
}
if (list)
silc_idcache_list_free(list);
+ if (!found) {
+ *clients_count = 0;
+ if (clients)
+ silc_free(clients);
+ return NULL;
+ }
+
return clients;
}