r23279: Replace occurrence of sid_binstring inside lookup_groupmem
authorMichael Adam <obnox@samba.org>
Thu, 31 May 2007 22:02:49 +0000 (22:02 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:23:02 +0000 (12:23 -0500)
by sid_string_static.

source/nsswitch/winbindd_ads.c

index 2dcd1284b303081565bf797e148a994bb6ab93cb..eda3dfb785b028ab3952e6b8b791f9ec4e2c8bdc 100644 (file)
@@ -901,7 +901,6 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
        ADS_STRUCT *ads = NULL;
        char *ldap_exp;
        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
-       char *sidstr;
        char **members = NULL;
        int i;
        size_t num_members = 0;
@@ -914,7 +913,6 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
        char **domains_nocache = NULL;     /* only needed for rpccli_lsa_lookup_sids */
        uint32 num_nocache = 0;
 
-
        DEBUG(10,("ads: lookup_groupmem %s sid=%s\n", domain->name, 
                  sid_string_static(group_sid)));
 
@@ -933,19 +931,14 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
                goto done;
        }
 
-       if ((sidstr = sid_binstring(group_sid)) == NULL) {
-               status = NT_STATUS_NO_MEMORY;
-               goto done;
-       }
-
        /* search for all members of the group */
-       if (!(ldap_exp = talloc_asprintf(mem_ctx, "(objectSid=%s)",sidstr))) {
-               SAFE_FREE(sidstr);
-               DEBUG(1, ("ads: lookup_groupmem: tallloc_asprintf for ldap_exp failed!\n"));
+       if (!(ldap_exp = talloc_asprintf(mem_ctx, "(objectSid=%s)",
+                                        sid_string_static(group_sid)))) 
+       {
+               DEBUG(1, ("ads: lookup_groupmem: talloc_asprintf for ldap_exp failed!\n"));
                status = NT_STATUS_NO_MEMORY;
                goto done;
        }
-       SAFE_FREE(sidstr);
 
        args.control = ADS_EXTENDED_DN_OID;
        args.val = ADS_EXTENDED_DN_HEX_STRING;