From: John Carr Date: Fri, 21 Aug 1992 02:55:12 +0000 (+0000) Subject: Call krb5_build_principal_ext instead of constructing a principal structure X-Git-Tag: krb5-1.0-beta2~116 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3fecd7a277f3ab86697bae4c1e232a6ad5806908;p=krb5.git Call krb5_build_principal_ext instead of constructing a principal structure git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2346 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/tgtname.c b/src/lib/krb5/krb/tgtname.c index b1c9e2c32..8b6b4261c 100644 --- a/src/lib/krb5/krb/tgtname.c +++ b/src/lib/krb5/krb/tgtname.c @@ -34,8 +34,6 @@ static char rcsid_tgtname_c [] = #include #include -static krb5_data tgtdata = {sizeof(TGTNAME)-1, TGTNAME}; - /* This is an internal-only function, used by krb5_get_cred_from_kdc() */ krb5_error_code @@ -43,26 +41,8 @@ krb5_tgtname(client, server, tgtprinc) const krb5_data *client, *server; krb5_principal *tgtprinc; { - krb5_principal retprinc; - krb5_error_code retval; - - if (!(retprinc = (krb5_data **)calloc(4, sizeof(krb5_data *)))) - return ENOMEM; - if (retval = krb5_copy_data(server, &retprinc[0])) { - xfree(retprinc); - return retval; - } - if (retval = krb5_copy_data(&tgtdata, &retprinc[1])) { - krb5_free_data(retprinc[0]); - xfree(retprinc); - return retval; - } - if (retval = krb5_copy_data(client, &retprinc[2])) { - krb5_free_data(retprinc[0]); - krb5_free_data(retprinc[1]); - xfree(retprinc); - return retval; - } - *tgtprinc = retprinc; - return 0; + return krb5_build_principal_ext(tgtprinc, server->length, server->data, + sizeof(TGTNAME) - 1, TGTNAME, + client->length, client->data, + 0); }