summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-04-10 12:58:14 +0200
committerVolker Lendecke <vl@samba.org>2010-04-19 14:27:18 +0200
commite80d0ecf8b716ddb1d5bdeeb641bfee10e35c345 (patch)
treeb8c7ea81fc7e5dbd410c9184b77a072452a1d0fd /nsswitch
parentfec712aca5d05a20f6f169fc821727737cd251c0 (diff)
downloadsamba-e80d0ecf8b716ddb1d5bdeeb641bfee10e35c345.tar.gz
samba-e80d0ecf8b716ddb1d5bdeeb641bfee10e35c345.tar.bz2
samba-e80d0ecf8b716ddb1d5bdeeb641bfee10e35c345.zip
libwbclient: Make wbcGetSidAliases not use talloc
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/libwbclient/wbc_sid.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/nsswitch/libwbclient/wbc_sid.c b/nsswitch/libwbclient/wbc_sid.c
index bbe6827bb6..52f0e249ef 100644
--- a/nsswitch/libwbclient/wbc_sid.c
+++ b/nsswitch/libwbclient/wbc_sid.c
@@ -532,8 +532,6 @@ wbcErr wbcGetSidAliases(const struct wbcDomainSid *dom_sid,
/* Build the sid list */
for (i=0; i<num_sids; i++) {
- wbcFreeMemory(sid_string);
- sid_string = NULL;
wbc_status = wbcSidToString(&sids[i], &sid_string);
BAIL_ON_WBC_ERROR(wbc_status);
@@ -541,8 +539,7 @@ wbcErr wbcGetSidAliases(const struct wbcDomainSid *dom_sid,
if (buflen < extra_data_len + sid_len + 2) {
buflen *= 2;
- extra_data = talloc_realloc(NULL, extra_data,
- char, buflen);
+ extra_data = (char *)realloc(extra_data, buflen);
if (!extra_data) {
wbc_status = WBC_ERR_NO_MEMORY;
BAIL_ON_WBC_ERROR(wbc_status);
@@ -554,6 +551,8 @@ wbcErr wbcGetSidAliases(const struct wbcDomainSid *dom_sid,
extra_data_len += sid_len;
extra_data[extra_data_len++] = '\n';
extra_data[extra_data_len] = '\0';
+ wbcFreeMemory(sid_string);
+ sid_string = NULL;
}
extra_data_len += 1;
@@ -571,8 +570,8 @@ wbcErr wbcGetSidAliases(const struct wbcDomainSid *dom_sid,
goto done;
}
- rids = talloc_array(NULL, uint32_t,
- response.data.num_entries);
+ rids = (uint32_t *)wbcAllocateMemory(response.data.num_entries,
+ sizeof(uint32_t), NULL);
BAIL_ON_PTR_ERROR(sids, wbc_status);
s = (const char *)response.extra_data.data;
@@ -595,9 +594,9 @@ wbcErr wbcGetSidAliases(const struct wbcDomainSid *dom_sid,
done:
wbcFreeMemory(sid_string);
- talloc_free(extra_data);
+ free(extra_data);
winbindd_free_response(&response);
- talloc_free(rids);
+ wbcFreeMemory(rids);
return wbc_status;
}