Fix leak in HMAC_CTX_free compat API
authorAnirudh Ramachandran <avr@fb.com>
Fri, 7 Apr 2017 18:58:27 +0000 (11:58 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 7 Apr 2017 19:07:55 +0000 (12:07 -0700)
commit9620aea0e79b41aa466ace8e322f9b7bb7005a4c
treef3afd8491e12d669fd3026b84787090a1d08cd21
parent905ba447c9990aef5087c8ec885cac4db9435310
Fix leak in HMAC_CTX_free compat API

Summary:
D4406876 replaced EVP_MD_CTX and HMAC_CTX on the stack with heap-allocated
versions. We omitted the _cleanup functions thinking those didn't actually free
anything, but turns out HMAC_CTX_cleanup internally calls EVP_MD_CTX_cleanup
which OPENSSL_frees a bunch of stuff.

Reviewed By: yfeldblum

Differential Revision: D4850388

fbshipit-source-id: 4ef1413a4105f3638140e4d12aeae64afe43f099
folly/portability/OpenSSL.cpp