---
name: "ll2_unref_context"
section: "3"
platform: "linux"
package: "util-linux-libs"
version: "2.42.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ll2_unref_context"
---

# ll2\_unref\_context(3)

Frees lastlog2 context.

## NAME

ll2\_unref\_context - Frees lastlog2 context.

## SYNOPSIS

**#include \<lastlog2.h\>**

\*context \* ll2\_unref\_context(ll2\_context \*context);

## DESCRIPTION

Frees lastlog2 context, which has been allocated by *ll2\_new\_context*.

```
const   char *db_path = "/var/lib/lastlog/lastlog2.db";
ll2_context *context = ll2_new_context(db_path);
/* other lastlog2 calls..... */
ll2_unref_context(context);
```

## AUTHORS

*Thorsten Kukuk* \<kukuk@suse.de\>

## SEE ALSO

[**lastlog2**(3)](/lastlog2/3.md), [**ll2\_new\_context**(3)](/ll2_new_context/3.md), [**ll2\_read\_all**(3)](/ll2_read_all/3.md), [**ll2\_write\_entry**(3)](/ll2_write_entry/3.md), [**ll2\_read\_entry**(3)](/ll2_read_entry/3.md), [**ll2\_remove\_entry**(3)](/ll2_remove_entry/3.md), [**ll2\_update\_login\_time**(3)](/ll2_update_login_time/3.md), [**ll2\_import\_lastlog**(3)](/ll2_import_lastlog/3.md)

## REPORTING BUGS

For bug reports, use the *issue tracker* \<https://github.com/util-linux/util-linux/issues\>.

## AVAILABILITY

The **liblastlog2** library is part of the util-linux package since version 2.40. It can be downloaded from *Linux Kernel Archive* \<https://www.kernel.org/pub/linux/utils/util-linux/\>.
