diff options
author | Bo Yang <boyang@samba.org> | 2009-10-24 09:20:00 +0800 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-10-26 08:56:44 +0100 |
commit | a0fbf067011ae50d63c6ed2a79f1ff00c2ce2d11 (patch) | |
tree | b6ef16cd53cbefee8dce3426de005658164c2734 /nsswitch | |
parent | 587ca743bf1491e97c984ce4bec5a9bd0a1ae69a (diff) | |
download | samba-a0fbf067011ae50d63c6ed2a79f1ff00c2ce2d11.tar.gz samba-a0fbf067011ae50d63c6ed2a79f1ff00c2ce2d11.tar.xz samba-a0fbf067011ae50d63c6ed2a79f1ff00c2ce2d11.zip |
s3: Fix crash in pam_winbind, another reference to freed memory.
Fix bug #6840.
Signed-off-by: Bo Yang <boyang@samba.org>
(cherry picked from commit b9a3f1dd85d168c15df846dba525f4f882d1acf8)
Diffstat (limited to 'nsswitch')
-rw-r--r-- | nsswitch/pam_winbind.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c index ab22c7cbb57..ec05f756975 100644 --- a/nsswitch/pam_winbind.c +++ b/nsswitch/pam_winbind.c @@ -1784,7 +1784,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) { @@ -3138,10 +3138,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 { |