buffer(3) | OpenSSL | buffer(3) |
BUF_strdup, BUF_strndup, BUF_memdup, BUF_strlcpy, BUF_strlcat - standard C library equivalents
BUF_MEM_new() allocates a new buffer of zero size.
BUF_MEM_free() frees up an already existing buffer. The data is zeroed before freeing up in case the buffer contains sensitive data.
BUF_MEM_grow() changes the size of an already existing buffer to len. Any data already in the buffer is preserved if it increases in size.
BUF_strdup(), BUF_strndup(), BUF_memdup(), BUF_strlcpy() and BUF_strlcat() are equivalents of the standard C library functions. The dup() functions use OPENSSL_malloc() underneath and so should be used in preference to the standard library for memory leak checking or replacing the malloc() function.
Memory allocated from these functions should be freed up using the OPENSSL_free() function.
BUF_strndup makes the explicit guarantee that it will never read past the first siz bytes of str.
BUF_MEM_free() has no return value.
BUF_MEM_grow() returns zero on error or the new size (i.e. len).
2016-03-10 | 1.0.1u |