From 8eb977233c50d27fe9ab4466a73db176445f36ad Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 6 Nov 2022 18:31:15 +0000 Subject: Document that OPENSSL_free() is required in some circumstances BoringSSL uses the common trick of storing malloc metadata in a prefix and then returning a pointer with an offset. Therefore callers must not call free() but OPENSSL_free(). Reported by dropk1ck via tobhe ok beck jsing --- src/lib/libcrypto/man/OPENSSL_malloc.3 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libcrypto/man/OPENSSL_malloc.3 b/src/lib/libcrypto/man/OPENSSL_malloc.3 index e6dba165f8..87f8d81ed1 100644 --- a/src/lib/libcrypto/man/OPENSSL_malloc.3 +++ b/src/lib/libcrypto/man/OPENSSL_malloc.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: OPENSSL_malloc.3,v 1.9 2019/06/10 09:49:48 schwarze Exp $ +.\" $OpenBSD: OPENSSL_malloc.3,v 1.10 2022/11/06 18:31:15 tb Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 10 2019 $ +.Dd $Mdocdate: November 6 2022 $ .Dt OPENSSL_MALLOC 3 .Os .Sh NAME @@ -108,3 +108,7 @@ and .Fn OPENSSL_strdup first appeared in OpenSSL 0.9.8j and have been available since .Ox 4.5 . +.Sh CAVEATS +If interoperability with other implementations is required, +memory returned by the library as bare pointers must be freed with +.Fn OPENSSL_free . -- cgit v1.2.3-55-g6feb