summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nsswitch/libwbclient/wbc_pwd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/nsswitch/libwbclient/wbc_pwd.c b/nsswitch/libwbclient/wbc_pwd.c
index 86d54a0f75..c7bfdb8fd8 100644
--- a/nsswitch/libwbclient/wbc_pwd.c
+++ b/nsswitch/libwbclient/wbc_pwd.c
@@ -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;
}