pam_winbind: fix segfault in pam_sm_authenticate()
authorDavid Disseldorp <ddiss@suse.de>
Wed, 2 Nov 2011 17:39:03 +0000 (18:39 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 26 Oct 2012 20:40:57 +0000 (22:40 +0200)
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

nsswitch/pam_winbind.c

index 83d7bb67da9e6f9c23716fe1f1dbf7e269098096..29d6f7c7bc37de8c7bebfeccab0f8c54d90887d7 100644 (file)
@@ -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;
 }