---
name: "libssh2_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_free"
---

# libssh2\_free(3)

deallocate libssh2 memory

## NAME

libssh2\_free - deallocate libssh2 memory

## SYNOPSIS

```
#include <libssh2.h>
void
libssh2_free(LIBSSH2_SESSION *session, void *ptr);
```

## DESCRIPTION

Deallocate memory allocated by earlier call to libssh2 functions. It uses the memory allocation callbacks provided by the application, if any. Otherwise, this will call free().

This function is mostly useful under Windows when libssh2 is linked to one run-time library and the application to another.

## AVAILABILITY

Added in libssh2 1.2.8

## SEE ALSO

**[libssh2\_session\_init\_ex(3)](/libssh2_session_init_ex/3.md)**
