From eefc99e340333ecb6f697469d5f85fcda789cb1e Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Sat, 24 Oct 2009 10:55:36 +0800 Subject: [PATCH] s3: Fix crash in pam_winbind, another reference to freed memory. Signed-off-by: Bo Yang --- 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 3d0c5ef..7454081 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 { -- 1.5.3