---
name: "bson_strdup"
section: "3"
platform: "linux"
package: "libbson-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/bson_strdup"
---

# bson\_strdup(3)

## SYNOPSIS

```
char *
bson_strdup (const char *str);
```

## PARAMETERS

- •

  **str**: A string.

## DESCRIPTION

Copies **str** into a new string. If **str** is NULL, then NULL is returned.

## RETURNS

A newly allocated string that should be freed with bson\_free().

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
