From c9f858c43c161c0e1b3463640ae5f267032b63b2 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Sat, 24 Oct 2009 09:20:00 +0800 Subject: [PATCH] s3: Fix crash in pam_winbind, another reference to freed memory. Signed-off-by: Bo Yang (cherry picked from commit b9a3f1dd85d168c15df846dba525f4f882d1acf8) --- 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 ab22c7c..ec05f75 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 { -- 1.5.3