I noticed while running evp_test I noticed in test1 that both that in EVP_EncryptInit_ex() and EVP_DecryptInit_ex() are allocating a new session. EVP_CIPHER_CTX_cleanup only frees the session used by EVP_DecryptInit_ex().
All the sessions are freed on exit. I am running with Engines so the OPENSSL_NO_ENGINE<http://qnxsrv7353:8080/opengrok/s?defs=OPENSSL_NO_ENGINE&project=mainline> is defined. I instrumented crypto_newsession and crypto_freesession to see the nid values. Is this expected?