From 43fdcecc6d6fe852b585b673b4a9a2c60ca66a4e Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Sat, 24 Apr 1999 16:38:23 +0000 Subject: [PATCH] cleanup git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6032 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/mcache.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/krb5/mcache.c b/lib/krb5/mcache.c index 6f1867835..d971967af 100644 --- a/lib/krb5/mcache.c +++ b/lib/krb5/mcache.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 1998 Kungliga Tekniska Högskolan + * Copyright (c) 1997-1999 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -48,6 +48,8 @@ typedef struct krb5_mcache { } *creds; } krb5_mcache; +#define MCC_CURSOR(C) ((struct link*)(C)) + static char* mcc_get_name(krb5_context context, krb5_ccache id) @@ -58,7 +60,7 @@ mcc_get_name(krb5_context context, static krb5_error_code mcc_resolve(krb5_context context, krb5_ccache *id, const char *res) { - abort (); + krb5_abortx(context, "unimplemented mcc_resolve called"); } static krb5_error_code @@ -165,7 +167,9 @@ mcc_get_first (krb5_context context, { krb5_mcache *m = (krb5_mcache *)id->data.data; - cursor->u.v = m->creds; + *cursor = malloc(sizeof(struct link*)); + + MCC_CURSOR(*cursor) = m->creds; return 0; } @@ -177,9 +181,9 @@ mcc_get_next (krb5_context context, { struct link *l; - l = (struct link *)cursor->u.v; + l = MCC_CURSOR(cursor); if (l != NULL) { - cursor->u.v = l->next; + MCC_CURSOR(*cursor) = l->next; return krb5_copy_creds_contents (context, &l->cred, creds); @@ -192,6 +196,7 @@ mcc_end_get (krb5_context context, krb5_ccache id, krb5_cc_cursor *cursor) { + free(*cursor); return 0; }