ocspapitest: properly check the return of memory-allocating functions
@@ -78,7 +78,10 @@ static OCSP_BASICRESP *make_dummy_resp(void)
ASN1_BIT_STRING *key = ASN1_BIT_STRING_new();
ASN1_INTEGER *serial = ASN1_INTEGER_new();
- if (!X509_NAME_add_entry_by_NID(name, NID_commonName, MBSTRING_ASC,
+ if (!TEST_ptr(name)
+ || !TEST_ptr(key)
+ || !TEST_ptr(serial)
+ || !X509_NAME_add_entry_by_NID(name, NID_commonName, MBSTRING_ASC,
namestr, -1, -1, 1)
|| !ASN1_BIT_STRING_set(key, keybytes, sizeof(keybytes))
|| !ASN1_INTEGER_set_uint64(serial, (uint64_t)1))
