Better checks for malloc failure in various METHOD functions

A number of the METHOD functions weren't properly handling malloc failures.

Reviewed-by: Richard Levitte <levitte@openssl.org>
4 files changed