From: Joseph Sutton Date: Mon, 22 May 2023 22:05:10 +0000 (+1200) Subject: s4:kdc: Use talloc_steal() rather than talloc_reference() X-Git-Tag: talloc-2.4.1~584 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65923be91e41c35550c521975f2ae4bc835983fc;p=thirdparty%2Fsamba.git s4:kdc: Use talloc_steal() rather than talloc_reference() This is consistent with the other uses in this file (in authn_policy_ntlm_client() and authn_policy_server()). Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/kdc/authn_policy_util.c b/source4/kdc/authn_policy_util.c index d10339682f4..c566d2760e1 100644 --- a/source4/kdc/authn_policy_util.c +++ b/source4/kdc/authn_policy_util.c @@ -508,14 +508,8 @@ int authn_policy_kerberos_client(struct ldb_context *samdb, authn_attrs.policy->allowed_to_authenticate_from); if (allowed_from != NULL && allowed_from->data != NULL) { - uint8_t *allowed_from_data = talloc_reference(client_policy, allowed_from->data); - if (allowed_from_data == NULL) { - ret = ENOMEM; - goto out; - } - client_policy->allowed_to_authenticate_from = data_blob_const( - allowed_from_data, + talloc_steal(client_policy, allowed_from->data), allowed_from->length); } }