Fixed potential null pointer dereferences
Removed some redundant not-null checks
Updated a check in cbtls_msg

The check does exactly the same thing as before, but this silences a cppcheck warning.
Merge pull request #828 from herwinw/cppcheck_possible_null_pointer_dereferences

Cppcheck possible null pointer dereferences