aboutsummaryrefslogtreecommitdiff
path: root/PORTING.md
diff options
context:
space:
mode:
Diffstat (limited to 'PORTING.md')
-rw-r--r--PORTING.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/PORTING.md b/PORTING.md
index e2fdb3a..c9a16d6 100644
--- a/PORTING.md
+++ b/PORTING.md
@@ -165,6 +165,17 @@ recommended to avoid the `out` parameter completely and always pass in `NULL`.
Note that less error-prone APIs are available for BoringSSL-specific code (see
below).
+### Memory allocation
+
+OpenSSL provides wrappers `OPENSSL_malloc` and `OPENSSL_free` over the standard
+`malloc` and `free`. Memory allocated by OpenSSL should be released with
+`OPENSSL_free`, not the standard `free`. However, by default, they are
+implemented directly using `malloc` and `free`, so code which mixes them up
+usually works.
+
+In BoringSSL, these functions maintain additional book-keeping to zero memory
+on `OPENSSL_free`, so any mixups must be fixed.
+
## Optional BoringSSL-specific simplifications
BoringSSL makes some changes to OpenSSL which simplify the API but remain