summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorBo Yang <boyang@samba.org>2009-10-24 09:20:00 +0800
committerBo Yang <boyang@samba.org>2009-10-24 09:36:23 +0800
commitb9a3f1dd85d168c15df846dba525f4f882d1acf8 (patch)
tree8cafbefc029ca126634843defacdd32278f9a1c6 /nsswitch
parent3050f8328862c7c77d3d692453bd9cc0885824e5 (diff)
downloadsamba-b9a3f1dd85d168c15df846dba525f4f882d1acf8.tar.gz
samba-b9a3f1dd85d168c15df846dba525f4f882d1acf8.tar.bz2
samba-b9a3f1dd85d168c15df846dba525f4f882d1acf8.zip
s3: Fix crash in pam_winbind, another reference to freed memory.
Signed-off-by: Bo Yang <boyang@samba.org>
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/pam_winbind.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index a2d372990c..93df55d88f 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -1788,7 +1788,7 @@ static int winbind_auth_request(struct pwb_context *ctx,
if (logon.blobs) {
wbcFreeMemory(logon.blobs);
}
- if (info && info->blobs) {
+ if (info && info->blobs && !p_info) {
wbcFreeMemory(info->blobs);
}
if (error && !p_error) {
@@ -3141,10 +3141,14 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
free(username_ret);
}
- wbcFreeMemory(info);
- wbcFreeMemory(policy);
}
+ if (info && info->blobs) {
+ wbcFreeMemory(info->blobs);
+ }
+ wbcFreeMemory(info);
+ wbcFreeMemory(policy);
+
goto out;
}
} else {