s4-kdc/db_glue: use krb5_copy_principal().
authorGünther Deschner <gd@samba.org>
Wed, 7 May 2014 15:14:14 +0000 (17:14 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 20 Mar 2015 22:25:53 +0000 (23:25 +0100)
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/kdc/db-glue.c

index aaf4c195e81e7be7a547ffe20266afd81f30e294..cc8e8558cb7dd9bf399e09f0d692a87028787da5 100644 (file)
@@ -1019,14 +1019,7 @@ static krb5_error_code samba_kdc_trust_message2entry(krb5_context context,
                goto out;
        }
 
-       entry_ex->entry.principal = malloc(sizeof(*(entry_ex->entry.principal)));
-       if (entry_ex->entry.principal == NULL) {
-               krb5_clear_error_message(context);
-               ret = ENOMEM;
-               goto out;
-       }
-
-       ret = copy_Principal(principal, entry_ex->entry.principal);
+       ret = krb5_copy_principal(context, principal, &entry_ex->entry.principal);
        if (ret) {
                krb5_clear_error_message(context);
                goto out;