Fix malloc failure handling of X509_ALGOR_set0()
[openssl.git] / crypto / cms / cms_env.c
index ca8f84f14a11593a5178ab90c36d270003e2dd3e..6374e20c4f5b4cd4a60afa4472c9d42b7247085c 100644 (file)
@@ -730,8 +730,8 @@ CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid,
         kekri->kekid->other->keyAttr = otherType;
     }
 
-    X509_ALGOR_set0(kekri->keyEncryptionAlgorithm,
-                    OBJ_nid2obj(nid), V_ASN1_UNDEF, NULL);
+    (void)X509_ALGOR_set0(kekri->keyEncryptionAlgorithm, OBJ_nid2obj(nid),
+                          V_ASN1_UNDEF, NULL); /* cannot fail */
 
     return ri;