For better performance it is recommended to use the modern OpenSSL EVP_MD_fetch API to load digest algorithms (i.e. explicit fetching), instead of the older implicit fetching API. As a side effect, using this API seems to avoid memory leaks with some versions of OpenSSL.