Welcome to little lamb

Code » limb » master » tree

[master] / src / doc / cdb.h / cdb_free.3.md

% limb manual
% cdb_free(3)
% limb 0.1.0
% 2023-07-24

# NAME

cdb_free - free memory associated with a cdb

# SYNOPSIS

    #include <limb/cdb.h>

```pre hl
void cdb_free(cdb *<em>c</em>)
```

# DESCRIPTION

The `cdb_free`() function frees all memory associated with the cdb pointed by
`c`. Notably, this renders invalid any and all pointers returned via a
*cdb_data* in relation to the cdb pointed by `c`.
If you intend to use such data /after/ having closing the database (i.e. after a
call to `cdb_free`()) then you need to copy it before.

! WARN: Important
! Any *cdb* that was /not/ initialized from a file, i.e. via
! [cdb_init_frommem](3), must *not* be freed via `cdb_free`().