The server should flow a new CONNACK with a new return code before disconnecting the TCP session if it receives a CONNECT message which is malformed.
Malformed means that the protocol name and version are correct but something else is incorrect, for example a User Name flag is set to indicate there is a User Name in the payload but the payload is empty.