Allow a *NULL to be passed to auth_ntlmssp_end().
authorJeremy Allison <jra@samba.org>
Fri, 15 Feb 2008 01:41:06 +0000 (17:41 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 15 Feb 2008 01:41:06 +0000 (17:41 -0800)
Jeremy.

source/auth/auth_ntlmssp.c

index 51b145a7608b3822bfe23e24a45f024e6adfb0f2..a49b36a0a125d60dc30ba8c09b870f62d3efa80a 100644 (file)
@@ -187,7 +187,13 @@ NTSTATUS auth_ntlmssp_start(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
 
 void auth_ntlmssp_end(AUTH_NTLMSSP_STATE **auth_ntlmssp_state)
 {
-       TALLOC_CTX *mem_ctx = (*auth_ntlmssp_state)->mem_ctx;
+       TALLOC_CTX *mem_ctx;
+
+       if (*auth_ntlmssp_state == NULL) {
+               return;
+       }
+
+       mem_ctx = (*auth_ntlmssp_state)->mem_ctx;
 
        if ((*auth_ntlmssp_state)->ntlmssp_state) {
                ntlmssp_end(&(*auth_ntlmssp_state)->ntlmssp_state);