Eliminate memory leaks in mem_dbg.c.
[openssl.git] / crypto / pkcs7 / pk7_lib.c
index 2012d7c87aa3bd9a1a0242808882f04d0279f8c3..45973fe8507cc3d08be0efeebea9446697873ac3 100644 (file)
@@ -456,11 +456,12 @@ int PKCS7_set_cipher(PKCS7 *p7, const EVP_CIPHER *cipher)
                }
 
        /* Check cipher OID exists and has data in it*/
-       objtmp = OBJ_nid2obj(EVP_CIPHER_type(cipher));
-       if(!objtmp || !objtmp->data) {
+       i = EVP_CIPHER_type(cipher);
+       if(i == NID_undef) {
                PKCS7err(PKCS7_F_PKCS7_SET_CIPHER,PKCS7_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER);
                return(0);
        }
+       objtmp = OBJ_nid2obj(i);
 
        ec->cipher = cipher;
        return 1;