1.\" $OpenBSD: OPENSSL_malloc.3,v 1.9 2019/06/10 09:49:48 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: June 10 2019 $ 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 SEE ALSO 90.Xr crypto 3 91.Sh HISTORY 92.Fn CRYPTO_malloc , 93.Fn CRYPTO_realloc , 94and 95.Fn CRYPTO_free 96first appeared in SSLeay 0.6.4 and have been available since 97.Ox 2.4 . 98.Pp 99.Fn OPENSSL_malloc , 100.Fn OPENSSL_realloc , 101and 102.Fn OPENSSL_free 103first appeared in OpenSSL 0.9.6 and have been available since 104.Ox 2.9 . 105.Pp 106.Fn CRYPTO_strdup 107and 108.Fn OPENSSL_strdup 109first appeared in OpenSSL 0.9.8j and have been available since 110.Ox 4.5 . 111