diff --git a/kdc/krb5tgs.c b/kdc/krb5tgs.c index 19dff5e01..894be5b9e 100644 --- a/kdc/krb5tgs.c +++ b/kdc/krb5tgs.c @@ -1295,7 +1295,7 @@ build_server_referral(krb5_context context, memset(&ref, 0, sizeof(ref)); if (referred_realm) { - ref.referred_realm = malloc(sizeof(ref.referred_realm)); + ALLOC(ref.referred_realm); if (ref.referred_realm == NULL) goto eout; *ref.referred_realm = strdup(referred_realm); @@ -1303,8 +1303,7 @@ build_server_referral(krb5_context context, goto eout; } if (true_principal_name) { - ref.true_principal_name = - malloc(sizeof(ref.true_principal_name)); + ALLOC(ref.true_principal_name); if (ref.true_principal_name == NULL) goto eout; ret = copy_PrincipalName(true_principal_name, ref.true_principal_name); @@ -1312,8 +1311,7 @@ build_server_referral(krb5_context context, goto eout; } if (requested_principal) { - ref.requested_principal_name = - malloc(sizeof(ref.requested_principal_name)); + ALLOC(ref.requested_principal_name); if (ref.requested_principal_name == NULL) goto eout; ret = copy_PrincipalName(requested_principal,