From ce24cffd4b2a0ff07871cc7c3fe0d803b5608d96 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Mon, 26 Mar 1990 16:51:50 +0000 Subject: [PATCH] use krb5_copy_key git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@420 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/kdc_util.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index ff9e9015f..e43737969 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -161,6 +161,7 @@ OLDDECLARG(krb5_keyblock **, key) { register struct kparg *whoisit = (struct kparg *)keyprocarg; register krb5_keyblock *newkey; + krb5_error_code retval; if (vno != whoisit->dbentry->kvno) return KRB5KRB_AP_ERR_BADKEYVER; @@ -168,12 +169,8 @@ OLDDECLARG(krb5_keyblock **, key) return KRB5KRB_AP_ERR_NOKEY; if (!(newkey = (krb5_keyblock *)malloc(sizeof(*newkey)))) return ENOMEM; - *newkey = *whoisit->key; - if (!(newkey->contents = (krb5_octet *)malloc(newkey->length))) { - free((char *)newkey); - return ENOMEM; - } - bcopy((char *)whoisit->key, (char *)newkey->contents, newkey->length); + if (retval = krb5_copy_keyblock(whoisit->key, newkey)) + return retval; *key = newkey; return 0; } -- 2.26.2