libwbclient: Make wbcGetGroups not use talloc
authorVolker Lendecke <vl@samba.org>
Sat, 3 Apr 2010 20:20:04 +0000 (22:20 +0200)
committerVolker Lendecke <vl@samba.org>
Mon, 19 Apr 2010 12:27:21 +0000 (14:27 +0200)
nsswitch/libwbclient/wbc_pwd.c

index 86d54a0f7515da68ec9500d99da8131a9d446cbc..c7bfdb8fd88305e8a76f967b1838f85461d78591 100644 (file)
@@ -599,7 +599,8 @@ wbcErr wbcGetGroups(const char *account,
                                        &response);
        BAIL_ON_WBC_ERROR(wbc_status);
 
-       groups = talloc_array(NULL, gid_t, response.data.num_entries);
+       groups = (gid_t *)wbcAllocateMemory(
+               sizeof(gid_t), response.data.num_entries, NULL);
        BAIL_ON_PTR_ERROR(groups, wbc_status);
 
        for (i = 0; i < response.data.num_entries; i++) {
@@ -614,9 +615,6 @@ wbcErr wbcGetGroups(const char *account,
 
  done:
        winbindd_free_response(&response);
-       if (groups) {
-               talloc_free(groups);
-       }
-
+       wbcFreeMemory(groups);
        return wbc_status;
 }