summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2011-11-02 18:39:03 +0100
committerAndreas Schneider <asn@cryptomilk.org>2012-10-26 22:40:57 +0200
commitec0f51b200d6e5b99bbd872e169621c17f33524c (patch)
tree6712d5ea1321e5e2ad1e7c489efb3b5c0516b1d3
parent281c62b33001571a4d926b30035e65d93d649660 (diff)
downloadsamba-ec0f51b200d6e5b99bbd872e169621c17f33524c.tar.gz
samba-ec0f51b200d6e5b99bbd872e169621c17f33524c.tar.bz2
samba-ec0f51b200d6e5b99bbd872e169621c17f33524c.zip
pam_winbind: fix segfault in pam_sm_authenticate()
Ensure the potentially null winbind context is not dereferenced on cleanup. https://bugzilla.samba.org/show_bug.cgi?id=8564 Signed-off-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Oct 26 22:40:57 CEST 2012 on sn-devel-104
-rw-r--r--nsswitch/pam_winbind.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index 83d7bb67da..29d6f7c7bc 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -2736,9 +2736,10 @@ out:
_pam_free_data_info3(pamh);
}
- _PAM_LOG_FUNCTION_LEAVE("pam_sm_authenticate", ctx, retval);
-
- TALLOC_FREE(ctx);
+ if (ctx != NULL) {
+ _PAM_LOG_FUNCTION_LEAVE("pam_sm_authenticate", ctx, retval);
+ TALLOC_FREE(ctx);
+ }
return retval;
}