- silc_hash_table_del_by_context_ext(cache->id_table, c->id, c,
- NULL, NULL, NULL, NULL,
- silc_idcache_destructor_dummy, NULL);
-
- /* Call the destructor */
- if (cache->destructor)
- cache->destructor(cache, c);
-
- /* Free the entry, it has been deleted from the hash tables */
- silc_free(c);
+ ret =
+ silc_hash_table_del_by_context_ext(cache->id_table, c->id, c,
+ NULL, NULL, NULL, NULL,
+ silc_idcache_destructor_dummy,
+ NULL);
+ if (ret == TRUE) {
+ /* Call the destructor */
+ if (cache->destructor)
+ cache->destructor(cache, c);
+
+ /* Free the entry, it has been deleted from the hash tables */
+ silc_idcache_destructor(NULL, c, NULL);
+ }