diff options
author | Bo Yang <boyang@samba.org> | 2009-10-24 09:20:00 +0800 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-10-26 11:52:34 +0100 |
commit | 10bd0b5e0dcc25f4e6803ca3507b3b09a85f378c (patch) | |
tree | e1f87ffcb79252e266da4824c97eb2b8c08df26d | |
parent | 00c42f0981a10144dc78b86336f5d5177780a4bd (diff) | |
download | samba-10bd0b5e0dcc25f4e6803ca3507b3b09a85f378c.tar.gz |
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)
(cherry picked from commit a0fbf067011ae50d63c6ed2a79f1ff00c2ce2d11)
-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 { |