s3-kerberos: use krb5 compat macros in fill_keytab_from_password().
authorGünther Deschner <gd@samba.org>
Tue, 31 Aug 2010 09:00:03 +0000 (11:00 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 31 Aug 2010 21:17:39 +0000 (23:17 +0200)
Guenther

source3/librpc/rpc/dcerpc_krb5.c

index ede4f6b5972bf582e521942df46583c1e02f20ba..dc1cec837013b072a11117ec9edfec998c929d8c 100644 (file)
@@ -128,10 +128,7 @@ static krb5_error_code fill_keytab_from_password(krb5_context krbctx,
        for (i = 0; enctypes[i]; i++) {
                krb5_keyblock *key = NULL;
 
-               if (!(key = SMB_MALLOC_P(krb5_keyblock))) {
-                       ret = ENOMEM;
-                       goto out;
-               }
+               key = KRB5_KT_KEY(&kt_entry);
 
                if (create_kerberos_key_from_string(krbctx, princ,
                                                    password, key,
@@ -139,13 +136,11 @@ static krb5_error_code fill_keytab_from_password(krb5_context krbctx,
                        DEBUG(10, ("Failed to create key for enctype %d "
                                   "(error: %s)\n",
                                   enctypes[i], error_message(ret)));
-                       SAFE_FREE(key);
                        continue;
                }
 
                kt_entry.principal = princ;
                kt_entry.vno = vno;
-               kt_entry.key = *key;
 
                ret = krb5_kt_add_entry(krbctx, keytab, &kt_entry);
                if (ret) {