summaryrefslogtreecommitdiff
path: root/nsswitch/libwbclient
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-04-04 11:57:39 +0200
committerVolker Lendecke <vl@samba.org>2010-04-19 14:27:23 +0200
commit406e55fafb54059a3fe91aa0111e83dad2fac6d5 (patch)
treef726a2069716268c1b48398d52727bdf61efd5cb /nsswitch/libwbclient
parentd36829c108eb161fd20894c6b03a0f0f0e73a1be (diff)
downloadsamba-406e55fafb54059a3fe91aa0111e83dad2fac6d5.tar.gz
samba-406e55fafb54059a3fe91aa0111e83dad2fac6d5.tar.bz2
samba-406e55fafb54059a3fe91aa0111e83dad2fac6d5.zip
libwbclient: Make wbc_create_logon_info not use talloc
Diffstat (limited to 'nsswitch/libwbclient')
-rw-r--r--nsswitch/libwbclient/wbc_pam.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/nsswitch/libwbclient/wbc_pam.c b/nsswitch/libwbclient/wbc_pam.c
index be82283918..892ccb7aa2 100644
--- a/nsswitch/libwbclient/wbc_pam.c
+++ b/nsswitch/libwbclient/wbc_pam.c
@@ -283,13 +283,22 @@ done:
return wbc_status;
}
+static void wbcLogonUserInfoDestructor(void *ptr)
+{
+ struct wbcLogonUserInfo *i = (struct wbcLogonUserInfo *)ptr;
+ wbcFreeMemory(i->info);
+ wbcFreeMemory(i->blobs);
+}
+
static wbcErr wbc_create_logon_info(struct winbindd_response *resp,
struct wbcLogonUserInfo **_i)
{
wbcErr wbc_status = WBC_ERR_SUCCESS;
struct wbcLogonUserInfo *i;
- i = talloc_zero(NULL, struct wbcLogonUserInfo);
+ i = (struct wbcLogonUserInfo *)wbcAllocateMemory(
+ sizeof(struct wbcLogonUserInfo), 1,
+ wbcLogonUserInfoDestructor);
BAIL_ON_PTR_ERROR(i, wbc_status);
wbc_status = wbc_create_auth_info(resp, &i->info);
@@ -320,11 +329,7 @@ static wbcErr wbc_create_logon_info(struct winbindd_response *resp,
*_i = i;
i = NULL;
done:
- if (!WBC_ERROR_IS_OK(wbc_status) && i) {
- wbcFreeMemory(i->blobs);
- }
-
- talloc_free(i);
+ wbcFreeMemory(i);
return wbc_status;
}