From a4d7062ef20af4b84343bd62380efc89c173f3f7 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Fri, 19 Apr 1991 16:46:41 +0000 Subject: [PATCH] clean up some XXX code git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2018 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/kdc_util.c | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index 988c32631..c6756a4bc 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -57,13 +57,15 @@ krb5_authdata ***output; /* now walk & copy */ retdata[i] = (krb5_authdata *)malloc(sizeof(*retdata[i])); if (!retdata[i]) { - /* XXX clean up */ + krb5_free_authdata(retdata); return ENOMEM; } *retdata[i] = **ptr; if (!(retdata[i]->contents = (krb5_octet *)malloc(retdata[i]->length))) { - /* XXX clean up */ + xfree(retdata[i]); + retdata[i] = 0; + krb5_free_authdata(retdata); return ENOMEM; } memcpy((char *) retdata[i]->contents, @@ -154,21 +156,6 @@ krb5_ticket **ticket; /* the caller will free the ticket when cleaning up */ #define cleanup_apreq() {apreq->ticket = 0; krb5_free_ap_req(apreq);} -#ifdef notdef - /* XXX why copy here? */ - krb5_free_data(request->server[0]); - if (retval = krb5_copy_data(apreq->ticket->server[0], - &request->server[0])) { - register krb5_data **foo; - request->server[0] = 0; - for (foo = &request->server[1]; *foo; foo++) - krb5_free_data(*foo); - /* XXX mem leak plugged? */ - cleanup_apreq(); - return retval; - } -#endif - if (isflagset(apreq->ap_options, AP_OPTS_USE_SESSION_KEY) || isflagset(apreq->ap_options, AP_OPTS_MUTUAL_REQUIRED)) { cleanup_apreq(); @@ -308,7 +295,7 @@ krb5_ticket **ticket; xfree(our_cksum.contents); krb5_free_data(scratch); cleanup_apreq(); - return KRB5KRB_AP_ERR_BAD_INTEGRITY; /* XXX wrong code? */ + return KRB5KRB_AP_ERR_BAD_INTEGRITY; } krb5_free_data(scratch); xfree(our_cksum.contents); -- 2.26.2