summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-04-03 14:52:08 +0200
committerVolker Lendecke <vl@samba.org>2010-04-19 14:27:23 +0200
commitd582caa1755114bda9e8789c444bb28c663a7e6b (patch)
treebfe8d9d49d0c6f04cfaa1755588d11a55618ff94
parentf4c8f5146c6ee06e9ca77d77cb7f19e522ca31ff (diff)
downloadsamba-d582caa1755114bda9e8789c444bb28c663a7e6b.tar.gz
samba-d582caa1755114bda9e8789c444bb28c663a7e6b.tar.bz2
samba-d582caa1755114bda9e8789c444bb28c663a7e6b.zip
libwbclient: Make wbc_create_error_info not use talloc
-rw-r--r--nsswitch/libwbclient/wbc_pam.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/nsswitch/libwbclient/wbc_pam.c b/nsswitch/libwbclient/wbc_pam.c
index 64dd02a3bf..f9e1e3848a 100644
--- a/nsswitch/libwbclient/wbc_pam.c
+++ b/nsswitch/libwbclient/wbc_pam.c
@@ -234,28 +234,37 @@ done:
return wbc_status;
}
+static void wbcAuthErrorInfoDestructor(void *ptr)
+{
+ struct wbcAuthErrorInfo *e = (struct wbcAuthErrorInfo *)ptr;
+ free(e->nt_string);
+ free(e->display_string);
+}
+
static wbcErr wbc_create_error_info(const struct winbindd_response *resp,
struct wbcAuthErrorInfo **_e)
{
wbcErr wbc_status = WBC_ERR_SUCCESS;
struct wbcAuthErrorInfo *e;
- e = talloc(NULL, struct wbcAuthErrorInfo);
+ e = (struct wbcAuthErrorInfo *)wbcAllocateMemory(
+ sizeof(struct wbcAuthErrorInfo), 1,
+ wbcAuthErrorInfoDestructor);
BAIL_ON_PTR_ERROR(e, wbc_status);
e->nt_status = resp->data.auth.nt_status;
e->pam_error = resp->data.auth.pam_error;
- e->nt_string = talloc_strdup(e, resp->data.auth.nt_status_string);
+ e->nt_string = strdup(resp->data.auth.nt_status_string);
BAIL_ON_PTR_ERROR(e->nt_string, wbc_status);
- e->display_string = talloc_strdup(e, resp->data.auth.error_string);
+ e->display_string = strdup(resp->data.auth.error_string);
BAIL_ON_PTR_ERROR(e->display_string, wbc_status);
*_e = e;
e = NULL;
done:
- talloc_free(e);
+ wbcFreeMemory(e);
return wbc_status;
}