xref: /openbsd-src/lib/libcrypto/man/OPENSSL_malloc.3 (revision 5e3c7963eb248119b7dfd4b0defad58a7d9cd306)
1.\"	$OpenBSD: OPENSSL_malloc.3,v 1.8 2018/03/27 17:35:50 schwarze Exp $
2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: March 27 2018 $
18.Dt OPENSSL_MALLOC 3
19.Os
20.Sh NAME
21.Nm OPENSSL_malloc ,
22.Nm OPENSSL_realloc ,
23.Nm OPENSSL_free ,
24.Nm OPENSSL_strdup ,
25.Nm CRYPTO_malloc ,
26.Nm CRYPTO_realloc ,
27.Nm CRYPTO_free ,
28.Nm CRYPTO_strdup
29.Nd legacy OpenSSL memory allocation wrappers
30.Sh SYNOPSIS
31.In openssl/crypto.h
32.Ft void *
33.Fo OPENSSL_malloc
34.Fa "size_t num"
35.Fc
36.Ft void *
37.Fo OPENSSL_realloc
38.Fa "void *addr"
39.Fa "size_t num"
40.Fc
41.Ft void
42.Fo OPENSSL_free
43.Fa "void *addr"
44.Fc
45.Ft char *
46.Fo OPENSSL_strdup
47.Fa "const char *str"
48.Fc
49.Ft void *
50.Fo CRYPTO_malloc
51.Fa "size_t num"
52.Fa "const char *file"
53.Fa "int line"
54.Fc
55.Ft void *
56.Fo CRYPTO_realloc
57.Fa "void *p"
58.Fa "size_t num"
59.Fa "const char *file"
60.Fa "int line"
61.Fc
62.Ft void
63.Fo CRYPTO_free
64.Fa "void *str"
65.Fa "const char *"
66.Fa int
67.Fc
68.Ft char *
69.Fo CRYPTO_strdup
70.Fa "const char *p"
71.Fa "const char *file"
72.Fa "int line"
73.Fc
74.Sh DESCRIPTION
75Do not use any of the interfaces documented here in new code.
76They are provided purely for compatibility with legacy application code.
77.Pp
78All 8 of these functions are wrappers around the corresponding
79standard
80.Xr malloc 3 ,
81.Xr realloc 3 ,
82.Xr free 3 ,
83and
84.Xr strdup 3
85functions.
86.Sh RETURN VALUES
87These functions return the same type and value as the corresponding
88standard functions.
89.Sh HISTORY
90.Fn CRYPTO_malloc ,
91.Fn CRYPTO_realloc ,
92and
93.Fn CRYPTO_free
94first appeared in SSLeay 0.6.4 and have been available since
95.Ox 2.4 .
96.Pp
97.Fn OPENSSL_malloc ,
98.Fn OPENSSL_realloc ,
99and
100.Fn OPENSSL_free
101first appeared in OpenSSL 0.9.6 and have been available since
102.Ox 2.9 .
103.Pp
104.Fn CRYPTO_strdup
105and
106.Fn OPENSSL_strdup
107first appeared in OpenSSL 0.9.8j and have been available since
108.Ox 4.5 .
109