kcm_ccache_remove_cred_internal, call kcm_cursor_update to move cursor
authorLove Hörnquist Åstrand <lha@kth.se>
Sun, 19 Oct 2008 20:30:24 +0000 (20:30 +0000)
committerLove Hörnquist Åstrand <lha@kth.se>
Sun, 19 Oct 2008 20:30:24 +0000 (20:30 +0000)
forward if it was stepping on to be removed entry.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23951 ec53bebd-3082-4978-b11e-865c3cabbd6b

kcm/cache.c

index 447787446b3d75c849586ee973f322968980e6a7..92388d29f6a88afad52ef3c3c0521d218fd583e9 100644 (file)
@@ -534,20 +534,6 @@ kcm_ccache_store_cred_internal(krb5_context context,
     return ret;
 }
 
-static void
-remove_cred(krb5_context context,
-           struct kcm_creds **c)
-{
-    struct kcm_creds *cred;
-
-    cred = *c;
-
-    *c = cred->next;
-
-    krb5_free_cred_contents(context, &cred->cred);
-    free(cred);
-}
-
 krb5_error_code
 kcm_ccache_remove_cred_internal(krb5_context context,
                                kcm_ccache ccache,
@@ -561,7 +547,12 @@ kcm_ccache_remove_cred_internal(krb5_context context,
 
     for (c = &ccache->creds; *c != NULL; c = &(*c)->next) {
        if (krb5_compare_creds(context, whichfields, mcreds, &(*c)->cred)) {
-           remove_cred(context, c);
+           struct kcm_creds *cred = *c;
+
+           kcm_cursor_update(context, ccache, cred);
+           *c = cred->next;
+           krb5_free_cred_contents(context, &cred->cred);
+           free(cred);
            ret = 0;
        }
     }