mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
test: check for NULL returns better
Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/15910)
This commit is contained in:
parent
711d5a2fc0
commit
f06c554760
@ -132,7 +132,8 @@ static int test_hmac_run(void)
|
||||
unsigned int len;
|
||||
int ret = 0;
|
||||
|
||||
ctx = HMAC_CTX_new();
|
||||
if (!TEST_ptr(ctx = HMAC_CTX_new()))
|
||||
return 0;
|
||||
HMAC_CTX_reset(ctx);
|
||||
|
||||
if (!TEST_ptr(ctx)
|
||||
|
@ -97,7 +97,10 @@ static void cleanup_object(void *vobj)
|
||||
|
||||
static void *init_object(void)
|
||||
{
|
||||
struct object_st *obj = OPENSSL_zalloc(sizeof(*obj));
|
||||
struct object_st *obj;
|
||||
|
||||
if (!TEST_ptr(obj = OPENSSL_zalloc(sizeof(*obj))))
|
||||
return NULL;
|
||||
|
||||
obj->p1 = p1_init;
|
||||
obj->p2 = p2_init;
|
||||
|
Loading…
Reference in New Issue
Block a user