s3:smbd: make sure we don't call conn_free() with a NULL pointer for SMB2
authorStefan Metzmacher <metze@samba.org>
Tue, 11 Aug 2009 16:09:05 +0000 (18:09 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 12 Aug 2009 11:27:59 +0000 (13:27 +0200)
metze

source3/smbd/smb2_tcon.c

index 5137f5c270b81cb70070c325f6b0acb58c24ffbb..4ed3fb5686070c12df8f82d2c014a752dea4ee16 100644 (file)
@@ -127,7 +127,9 @@ static int smbd_smb2_tcon_destructor(struct smbd_smb2_tcon *tcon)
        idr_remove(tcon->session->tcons.idtree, tcon->tid);
        DLIST_REMOVE(tcon->session->tcons.list, tcon);
 
-       conn_free(tcon->compat_conn);
+       if (tcon->compat_conn) {
+               conn_free(tcon->compat_conn);
+       }
 
        tcon->compat_conn = NULL;
        tcon->tid = 0;