}
- 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",
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;