summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/winbindd_async.c4
-rw-r--r--source3/nsswitch/winbindd_group.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/source3/nsswitch/winbindd_async.c b/source3/nsswitch/winbindd_async.c
index 93dea6f48c..3319fda406 100644
--- a/source3/nsswitch/winbindd_async.c
+++ b/source3/nsswitch/winbindd_async.c
@@ -1135,13 +1135,13 @@ enum winbindd_result winbindd_dual_getsidaliases(struct winbindd_domain *domain,
}
- if (!print_sidlist(NULL, sids, num_sids, &sidstr, &len)) {
+ if (!print_sidlist(state->mem_ctx, sids, num_sids, &sidstr, &len)) {
DEBUG(0, ("Could not print_sidlist\n"));
state->response.extra_data.data = NULL;
return WINBINDD_ERROR;
}
- state->response.extra_data.data = sidstr;
+ state->response.extra_data.data = SMB_STRDUP(sidstr);
if (state->response.extra_data.data != NULL) {
DEBUG(10, ("aliases_list: %s\n",
diff --git a/source3/nsswitch/winbindd_group.c b/source3/nsswitch/winbindd_group.c
index deee07413c..1b21352c86 100644
--- a/source3/nsswitch/winbindd_group.c
+++ b/source3/nsswitch/winbindd_group.c
@@ -1384,12 +1384,15 @@ enum winbindd_result winbindd_dual_getuserdomgroups(struct winbindd_domain *doma
return WINBINDD_OK;
}
- if (!print_sidlist(NULL, groups, num_groups, &sidstring, &len)) {
- DEBUG(0, ("malloc failed\n"));
+ if (!print_sidlist(state->mem_ctx, groups, num_groups, &sidstring, &len)) {
+ DEBUG(0, ("talloc failed\n"));
return WINBINDD_ERROR;
}
- state->response.extra_data.data = sidstring;
+ state->response.extra_data.data = SMB_STRDUP(sidstring);
+ if (!state->response.extra_data.data) {
+ return WINBINDD_ERROR;
+ }
state->response.length += len+1;
state->response.data.num_entries = num_groups;