---
name: "firestring_strdup"
section: "3"
platform: "linux"
package: "libfirestring-dev"
version: "0.9.12-8"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/firestring_strdup"
---

# firestring\_strdup(3)

strdup(3) with internal result checking

## NAME

firestring\_strdup - [**strdup**(3)](/strdup/3.md) with internal result checking

## SYNOPSIS

**#include \<firestring.h\>**\
 **-lfirestring**

**char \*firestring\_strdup(const char \* const** *input***)**

## DESCRIPTION

firestring\_strdup() acts exactly like [**strdup**(3)](/strdup/3.md) except that it detects malloc failures, prints an error and [**exit**(3)](/exit/3.md) with exit status EXIT\_FAILURE.  In most programs, malloc failures are unrecoverable, and this is the preferred behaviour.

## RETURN VALUE

If firestring\_strdup() returns, it **always** returns a copy of the string *input*. It **never** returns *NULL*.

## AUTHOR

Ian Gulliver \<ian@penguinhosting.net\>

## SEE ALSO

[**libfirestring**(3)](/libfirestring/3.md)
