---
name: "libressl-ERR_asprintf_error_data"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-ERR_asprintf_error_data"
---

# libressl-ERR\_asprintf\_error\_data(3)

record a LibreSSL error using a formatted string

## NAME

**ERR\_asprintf\_error\_data** – record a LibreSSL error using a formatted string

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/err.h\>**

*void*\

**ERR\_asprintf\_error\_data**(*char \* format*, *...*);

## DESCRIPTION

**ERR\_asprintf\_error\_data** builds a string using [asprintf(3)](/asprintf/3.md) 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)](/asprintf/3.md) 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**().

## SEE ALSO

ERR(3), ERR\_put\_error(3), [printf(3)](/printf/3.md)

## HISTORY

**ERR\_asprintf\_error\_data** appeared in OpenBSD 5.6 and is available in all versions of LibreSSL.
