Standardise our style for checking malloc failures
if we have a malloc |x = OPENSSL_malloc(...)| sometimes we check |x| for NULL and sometimes we treat it as a boolean |if(!x) ...|. Standardise the approach in libssl. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
This commit is contained in:
@@ -1039,7 +1039,7 @@ static int ssl_cipher_strength_sort(CIPHER_ORDER **head_p,
|
||||
}
|
||||
|
||||
number_uses = OPENSSL_zalloc(sizeof(int) * (max_strength_bits + 1));
|
||||
if (!number_uses) {
|
||||
if (number_uses == NULL) {
|
||||
SSLerr(SSL_F_SSL_CIPHER_STRENGTH_SORT, ERR_R_MALLOC_FAILURE);
|
||||
return (0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user