]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:kdc: Use talloc_steal() rather than talloc_reference()
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 22 May 2023 22:05:10 +0000 (10:05 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 24 May 2023 00:50:31 +0000 (00:50 +0000)
This is consistent with the other uses in this file (in
authn_policy_ntlm_client() and authn_policy_server()).

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/kdc/authn_policy_util.c

index d10339682f413d321486b79de94ac684589651b1..c566d2760e117c43cbf01caa97c51931fa57296d 100644 (file)
@@ -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);
                }
        }