Free vp on error

Closes Coverity #982097
Check size of raw attributes in TTLS

Closes Coverity #982096
There's no need to memset data to zero

Closes Coverity #982095
Use sizeof(struct) not sizeof(*struct)

Closes Coverity #982094
Remove unnecessary check

Closes Coverity #982093
Add missing break

closes Coverity #982090
Note fall-through

Closes Coverity #982089
Add missing break

Closes Coverity #982088
Add missing break

Closes Coverity #982087
Unlock on error

Closes Coverity #982086