From 1f82ad5700c700e952b54ecd769894cc40ab671e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 11 Dec 2008 05:05:11 +0000 Subject: [PATCH] read dead code, cid#5 git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24132 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kcm/cache.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/kcm/cache.c b/kcm/cache.c index 6f46cd9fa..96080689e 100644 --- a/kcm/cache.c +++ b/kcm/cache.c @@ -182,27 +182,17 @@ kcm_ccache_alloc(krb5_context context, goto out; /* - * Then try and find an empty slot - * XXX we need to recycle slots for this to actually do anything + * Create an enpty slot for us. */ if (slot == NULL) { - for (; p != NULL; p = p->next) { - if ((p->flags & KCM_FLAGS_VALID) == 0) { - slot = p; - break; - } - } - + slot = (kcm_ccache_data *)malloc(sizeof(*slot)); if (slot == NULL) { - slot = (kcm_ccache_data *)malloc(sizeof(*slot)); - if (slot == NULL) { - ret = KRB5_CC_NOMEM; - goto out; - } - slot->next = ccache_head; - HEIMDAL_MUTEX_init(&slot->mutex); - new_slot = 1; + ret = KRB5_CC_NOMEM; + goto out; } + slot->next = ccache_head; + HEIMDAL_MUTEX_init(&slot->mutex); + new_slot = 1; } slot->name = strdup(name);