From d7396a3cea0860dda5e67d2ecd542db76924a5d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 1 Nov 2005 09:41:59 +0000 Subject: [PATCH] (gss_krb5_import_ccache): Use krb5_cc_get_full_name. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16275 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/gssapi/copy_ccache.c | 11 ++--------- lib/gssapi/krb5/copy_ccache.c | 11 ++--------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/lib/gssapi/copy_ccache.c b/lib/gssapi/copy_ccache.c index 90d57c8a4..bcdb0cf00 100644 --- a/lib/gssapi/copy_ccache.c +++ b/lib/gssapi/copy_ccache.c @@ -115,18 +115,11 @@ gss_krb5_import_ccache(OM_uint32 *minor_status, } { - const char *type, *name; char *str; - type = krb5_cc_get_type(gssapi_krb5_context, in); - name = krb5_cc_get_name(gssapi_krb5_context, in); - - if (asprintf(&str, "%s:%s", type, name) == -1) { - krb5_set_error_string(gssapi_krb5_context, - "malloc - out of memory"); - kret = ENOMEM; + kret = krb5_cc_get_full_name(gssapi_krb5_context, in, &str); + if (kret) goto out; - } kret = krb5_cc_resolve(gssapi_krb5_context, str, &handle->ccache); free(str); diff --git a/lib/gssapi/krb5/copy_ccache.c b/lib/gssapi/krb5/copy_ccache.c index 90d57c8a4..bcdb0cf00 100644 --- a/lib/gssapi/krb5/copy_ccache.c +++ b/lib/gssapi/krb5/copy_ccache.c @@ -115,18 +115,11 @@ gss_krb5_import_ccache(OM_uint32 *minor_status, } { - const char *type, *name; char *str; - type = krb5_cc_get_type(gssapi_krb5_context, in); - name = krb5_cc_get_name(gssapi_krb5_context, in); - - if (asprintf(&str, "%s:%s", type, name) == -1) { - krb5_set_error_string(gssapi_krb5_context, - "malloc - out of memory"); - kret = ENOMEM; + kret = krb5_cc_get_full_name(gssapi_krb5_context, in, &str); + if (kret) goto out; - } kret = krb5_cc_resolve(gssapi_krb5_context, str, &handle->ccache); free(str);