Use EVP_MD_CTX_destroy() instead of _free().

Thanks to azrdev for pointing out the build failure on Fedora 23.
This commit is contained in:
Guus Sliepen 2016-06-22 23:08:30 +02:00
parent 9b148fd844
commit 2de5d866b5

View file

@ -101,11 +101,11 @@ bool digest_create(digest_t *digest, const void *indata, size_t inlen, void *out
|| !EVP_DigestUpdate(ctx, indata, inlen) || !EVP_DigestUpdate(ctx, indata, inlen)
|| !EVP_DigestFinal(ctx, tmpdata, NULL)) { || !EVP_DigestFinal(ctx, tmpdata, NULL)) {
logger(DEBUG_ALWAYS, LOG_DEBUG, "Error creating digest: %s", ERR_error_string(ERR_get_error(), NULL)); logger(DEBUG_ALWAYS, LOG_DEBUG, "Error creating digest: %s", ERR_error_string(ERR_get_error(), NULL));
EVP_MD_CTX_free(ctx); EVP_MD_CTX_destroy(ctx);
return false; return false;
} }
EVP_MD_CTX_free(ctx); EVP_MD_CTX_destroy(ctx);
} }
memcpy(outdata, tmpdata, digest->maclength); memcpy(outdata, tmpdata, digest->maclength);