]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Revert "s3:libads: Don’t do first loop iteration if ‘attr’ is NULL"
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 5 Oct 2023 22:18:10 +0000 (11:18 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 13 Oct 2023 02:18:31 +0000 (02:18 +0000)
Fixes CID 1547073: Control flow issues (DEADCODE).

This reverts commit 184a48d65772f359bd81f83256daada8c9e500b3.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/libads/ldap.c

index 740bc6bb43458ff068c5e5584e75ae8aae8c11c0..509196834aeb373871b1a47540782694aed0fff7 100644 (file)
@@ -3176,10 +3176,6 @@ int ads_count_replies(ADS_STRUCT *ads, void *res)
        for (attr = ldap_first_attribute(ads->ldap.ld, (LDAPMessage *)msg, &ptr);
             attr;
             attr = ldap_next_attribute(ads->ldap.ld, (LDAPMessage *)msg, ptr)) {
-               if (attr == NULL) {
-                       break;
-               }
-
                /* we ignore the fact that this is utf8, as all attributes are ascii... */
                if (strnequal(attr, expected_range_attrib, strlen(expected_range_attrib))) {
                        range_attr = attr;