summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-12-21 12:18:17 -0800
committerJeremy Allison <jra@samba.org>2007-12-21 12:18:17 -0800
commite0a054ded334ce5ddeafdfbbdf1ee99e526386f5 (patch)
treee9222a464119107f473e3091543ffb6c04ca4a07
parent0c3f431abaf2f33e11f74cbc868b5e1da255bfff (diff)
downloadsamba-e0a054ded334ce5ddeafdfbbdf1ee99e526386f5.tar.gz
samba-e0a054ded334ce5ddeafdfbbdf1ee99e526386f5.tar.bz2
samba-e0a054ded334ce5ddeafdfbbdf1ee99e526386f5.zip
Fix const warning.
Jeremy. (This used to be commit 5159f897ddaad1878fff629cc074dd71b2b3f4ab)
-rw-r--r--source3/nsswitch/libwbclient/wbc_sid.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/source3/nsswitch/libwbclient/wbc_sid.c b/source3/nsswitch/libwbclient/wbc_sid.c
index 5e7cb9a61b..c877e1d9d4 100644
--- a/source3/nsswitch/libwbclient/wbc_sid.c
+++ b/source3/nsswitch/libwbclient/wbc_sid.c
@@ -298,7 +298,7 @@ wbcErr wbcLookupSid(const struct wbcDomainSid *sid,
wbcErr wbcLookupRids(struct wbcDomainSid *dom_sid,
int num_rids,
uint32_t *rids,
- const char **domain_name,
+ const char **pp_domain_name,
const char ***names,
enum wbcSidType **types)
{
@@ -308,6 +308,7 @@ wbcErr wbcLookupRids(struct wbcDomainSid *dom_sid,
struct winbindd_request request;
struct winbindd_response response;
char *sid_string = NULL;
+ char *domain_name = NULL;
wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
if (!dom_sid || (num_rids == 0)) {
@@ -357,8 +358,8 @@ wbcErr wbcLookupRids(struct wbcDomainSid *dom_sid,
&response);
free(ridlist);
- *domain_name = strdup(response.data.domain_name);
- BAIL_ON_PTR_ERROR((*domain_name), wbc_status);
+ domain_name = strdup(response.data.domain_name);
+ BAIL_ON_PTR_ERROR(domain_name, wbc_status);
*names = (const char**)malloc(sizeof(char*) * num_rids);
BAIL_ON_PTR_ERROR((*names), wbc_status);
@@ -408,12 +409,14 @@ wbcErr wbcLookupRids(struct wbcDomainSid *dom_sid,
done:
if (!WBC_ERROR_IS_OK(wbc_status)) {
- if (*domain_name)
- free(*domain_name);
+ if (domain_name)
+ free(domain_name);
if (*names)
free(*names);
if (*types)
free(*types);
+ } else {
+ *pp_domain_name = domain_name;
}
return wbc_status;