diff options
author | Bo Yang <boyang@samba.org> | 2009-10-24 10:55:36 +0800 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2010-01-13 14:00:52 +0100 |
commit | f98f6d210acc552ac35598950c250e8b87c7cc76 (patch) | |
tree | e1dc99a2d435838de821b9957468af05dea44e91 /source | |
parent | 26cc0331a3776d5b4ec9e4e5a65211968d3598b7 (diff) | |
download | samba-f98f6d210acc552ac35598950c250e8b87c7cc76.tar.gz samba-f98f6d210acc552ac35598950c250e8b87c7cc76.tar.xz samba-f98f6d210acc552ac35598950c250e8b87c7cc76.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 1791b1cc43ce744c73b473aff0e311acbdf0ee4e)
Diffstat (limited to 'source')
-rw-r--r-- | source/nsswitch/pam_winbind.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/nsswitch/pam_winbind.c b/source/nsswitch/pam_winbind.c index 3d0c5ef90e5..74540817af0 100644 --- a/source/nsswitch/pam_winbind.c +++ b/source/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 { |