Free more memory in cleanup functions.
The extra free in ex_data_impl.c is fixing a mistake: when calling
|CRYPTO_cleanup_all_ex_data| the |EX_CLASS_ITEM| itself wouldn't be
freed.
The change in err_impl.c is to free the thread-id hash also. This allows
programs to free absolutely all memory allocated by BoringSSL, which
allows fuzz testing to find any memory leaks.
Change-Id: I1e518adf2b3e0efa7d7f00f7ab4e65e1dc70161e
Reviewed-on: https://boringssl-review.googlesource.com/2670
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/ex_data_impl.c b/crypto/ex_data_impl.c
index cac1daa..f55b369 100644
--- a/crypto/ex_data_impl.c
+++ b/crypto/ex_data_impl.c
@@ -167,6 +167,7 @@
* structures. */
static void class_free(EX_CLASS_ITEM *item) {
sk_CRYPTO_EX_DATA_FUNCS_pop_free(item->meth, data_funcs_free);
+ OPENSSL_free(item);
}
static LHASH_OF(EX_CLASS_ITEM) *get_classes(void) {