---
name: "libssh2_agent_free"
section: "3"
platform: "linux"
package: "libssh2"
version: "1.11.1-7"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libssh2_agent_free"
---

# libssh2\_agent\_free(3)

free an ssh-agent handle

## NAME

libssh2\_agent\_free - free an ssh-agent handle

## SYNOPSIS

```
#include <libssh2.h>
void
libssh2_agent_free(LIBSSH2_AGENT *agent);
```

## DESCRIPTION

Free an ssh-agent handle. This function also frees the internal collection of public keys.

## RETURN VALUE

None.

## AVAILABILITY

Added in libssh2 1.2

## SEE ALSO

**[libssh2\_agent\_init(3)](/libssh2_agent_init/3.md)** **[libssh2\_agent\_disconnect(3)](/libssh2_agent_disconnect/3.md)**
