---
name: "bson_zero_free"
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_zero_free"
---

# bson\_zero\_free(3)

## SYNOPSIS

```
void
bson_zero_free (void *mem, size_t size);
```

## PARAMETERS

- •

  **mem**: A memory region.

- •

  **size**: The size of **mem**.

## DESCRIPTION

This function behaves like *bson\_free()* except that it zeroes the memory first. This can be useful if you are storing passwords or other similarly important data. Note that if it truly is important, you probably want a page protected with **mlock()** as well to prevent it swapping to disk.

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
