libressl-ERR_asprintf_error_data(3)

libressl-ERR_asprintf_error_data3

Record a libressl error using a formatted string

Usage

Crypto Library (libcrypto, -lcrypto)

#include <openssl/err.h>

void

ERR_asprintf_error_data(char * format, ...);

Overview

ERR_asprintf_error_data builds a string using asprintf(3) called with the provided format and arguments. The resulting string is then associated with the error code that was most recently added. If asprintf(3) fails, the string "malloc failed" is associated instead.

ERR_asprintf_error_data is intended to be used instead of the OpenSSL functions ERR_add_error_data() and ERR_add_error_vdata().

History

ERR_asprintf_error_data appeared in OpenBSD 5.6 and is available in all versions of LibreSSL.

From libressl 4.4.0-1 in Arch Linux 2026-11-01. Parsed by carta from the page's mdoc source.