summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-11-06 18:31:16 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-11-06 18:31:16 +0000
commit826be14ad189f0f2a173a207411fbbfc6998ddfa (patch)
tree785f956eaaae31c29ce0d811cd84a6f81c7a2ab9
parentae7ba1ebe2f23698f517e59976869d098e9da09a (diff)
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
-rw-r--r--lib/libcrypto/man/OPENSSL_malloc.38
1 files changed, 6 insertions, 2 deletions
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 <schwarze@openbsd.org>
.\"
@@ -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 .