Don't clean up uninitialised EVP_CIPHER_CTX on error (CID 483259).
[openssl.git] / crypto / cms / cms_pwri.c
index 8a574616d22b36ea27698425aee80488434a9e26..28f8f261a6940b08e115a9b4a4bf53c0872bf8ea 100644 (file)
@@ -93,9 +93,10 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
        X509_ALGOR *encalg = NULL;
        unsigned char iv[EVP_MAX_IV_LENGTH];
        int ivlen;
+
        env = cms_get0_enveloped(cms);
        if (!env)
-               goto err;
+               return NULL;
 
        if (wrap_nid <= 0)
                wrap_nid = NID_id_alg_PWRI_KEK;