s3:winbind:idmap_ldap: fix a crash bug in idmap_ldap_unixids_to_sids (#6387)
[samba.git] / source3 / winbindd / idmap_ldap.c
index 7224589076e1157b5901c5dcea834f3d16e7c198..854fd21df8ef918f0caf7ba0b2a88b29de925a8d 100644 (file)
@@ -892,6 +892,7 @@ static NTSTATUS idmap_ldap_unixids_to_sids(struct idmap_domain *dom,
        TALLOC_CTX *memctx;
        struct idmap_ldap_context *ctx;
        LDAPMessage *result = NULL;
+       LDAPMessage *entry = NULL;
        const char *uidNumber;
        const char *gidNumber;
        const char **attr_list;
@@ -979,7 +980,6 @@ again:
        }
 
        for (i = 0; i < count; i++) {
-               LDAPMessage *entry = NULL;
                char *sidstr = NULL;
                char *tmp = NULL;
                enum id_type type;