DOKK / manpages / debian 11 / libbson-doc / bson_zero_free.3.en
BSON_ZERO_FREE(3) libbson BSON_ZERO_FREE(3)

bson_zero_free - bson_zero_free()

void
bson_zero_free (void *mem, size_t size);


  • mem: A memory region.
  • size: The size of mem.

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.

MongoDB, Inc

2017-present, MongoDB, Inc

June 4, 2021 1.17.6