From: Pekka Riikonen Date: Wed, 9 Oct 2002 16:52:51 +0000 (+0000) Subject: silc_hash_table_find_foreach interface change. X-Git-Tag: silc.client.0.9.6~43 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=912c824230695936999c0c54f02996ffa3b6409c;p=silc.git silc_hash_table_find_foreach interface change. --- diff --git a/lib/silccore/silcidcache.c b/lib/silccore/silcidcache.c index a23d6aca..44afd47b 100644 --- a/lib/silccore/silcidcache.c +++ b/lib/silccore/silcidcache.c @@ -305,6 +305,9 @@ static void silc_idcache_purge_foreach(void *key, void *context, SilcUInt32 curtime = time(NULL); SilcIDCacheEntry c = (SilcIDCacheEntry)context; + if (!context) + return; + if (c->expire && c->expire < curtime) { /* Remove the entry from the hash tables */ if (c->name) @@ -373,6 +376,8 @@ static void silc_idcache_get_all_foreach(void *key, void *context, void *user_context) { SilcIDCacheList list = (SilcIDCacheList)user_context; + if (!context) + return; silc_idcache_list_add(list, (SilcIDCacheEntry)context); }