diff options
author | assar <assar@FreeBSD.org> | 2001-02-13 16:46:19 +0000 |
---|---|---|
committer | assar <assar@FreeBSD.org> | 2001-02-13 16:46:19 +0000 |
commit | 3a971fe69aad52dfd248901ae796e64a96ae3e37 (patch) | |
tree | ac7b5c62510ffa9f0316643bcb19a3fed3d5bef7 /crypto/heimdal/kdc/misc.c | |
parent | 2934fc23653f64b32f4db32233d7eda11ca274f0 (diff) | |
parent | ebfe6dc471c206300fd82c7c0fd145f683aa52f6 (diff) | |
download | FreeBSD-src-3a971fe69aad52dfd248901ae796e64a96ae3e37.zip FreeBSD-src-3a971fe69aad52dfd248901ae796e64a96ae3e37.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r72445,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'crypto/heimdal/kdc/misc.c')
-rw-r--r-- | crypto/heimdal/kdc/misc.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/crypto/heimdal/kdc/misc.c b/crypto/heimdal/kdc/misc.c index e476ebc..aebdc68 100644 --- a/crypto/heimdal/kdc/misc.c +++ b/crypto/heimdal/kdc/misc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,17 +33,20 @@ #include "kdc_locl.h" -RCSID("$Id: misc.c,v 1.18 1999/12/02 17:05:00 joda Exp $"); +RCSID("$Id: misc.c,v 1.22 2001/01/30 03:54:21 assar Exp $"); struct timeval now; -hdb_entry* -db_fetch(krb5_principal principal) +krb5_error_code +db_fetch(krb5_principal principal, hdb_entry **h) { hdb_entry *ent; - krb5_error_code ret; + krb5_error_code ret = HDB_ERR_NOENTRY; int i; - ALLOC(ent); + + ent = malloc (sizeof (*ent)); + if (ent == NULL) + return ENOMEM; ent->principal = principal; for(i = 0; i < num_db; i++) { @@ -55,9 +58,19 @@ db_fetch(krb5_principal principal) } ret = db[i]->fetch(context, db[i], HDB_F_DECRYPT, ent); db[i]->close(context, db[i]); - if(ret == 0) - return ent; + if(ret == 0) { + *h = ent; + return 0; + } } free(ent); - return NULL; + return ret; +} + +void +free_ent(hdb_entry *ent) +{ + hdb_free_entry (context, ent); + free (ent); } + |