From: tb Date: Sun, 6 Nov 2022 18:31:15 +0000 (+0000) Subject: Document that OPENSSL_free() is required in some circumstances X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a25572ca91e91b3dece5c75c7582bf3c0ddb9f9a;p=openbsd 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 --- diff --git a/lib/libcrypto/man/OPENSSL_malloc.3 b/lib/libcrypto/man/OPENSSL_malloc.3 index e6dba165f8e..87f8d81ed12 100644 --- a/lib/libcrypto/man/OPENSSL_malloc.3 +++ b/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 .