---
name: "nutclient_destroy"
section: "3"
platform: "linux"
package: "libnutclient-dev"
version: "2.8.1-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/libnutclient_general"
---

# nutclient\_destroy(3)

General and utility functions in Network UPS Tools high-level client access library

Part of [libnutclient\_general(3)](/libnutclient_general/3.md).

## NAME

libnutclient\_general, nutclient\_destroy, strarr\_alloc, strarr\_free - General and utility functions in Network UPS Tools high-level client access library

## SYNOPSIS

```
#include <nutclient.h>
```

```
typedef void* NUTCLIENT_t;
```

```
void nutclient_destroy(NUTCLIENT_t client);
```

```
typedef char** strarr;
```

```
strarr strarr_alloc(unsigned short count);
```

```
void strarr_free(strarr arr);
```

## DESCRIPTION

The **nutclient\_destroy()** function destroys a *NUTCLIENT\_t* or derived (like *NUTCLIENT\_TCP\_t*) connection object, and frees allocated memory.

The **strarr** type represents an array of C strings (array of char pointer). The array must always be terminated by a NULL pointer. Pointed strings must be allocated by (x)calloc or (x)strdup.

The **strarr\_alloc()** function allocates a *strarr* array with the specified number of (non-initialized) string pointers. Another additional pointer set to 0 is added at the end of the array.

The **strarr\_free** function frees a *strarr* array. It also frees all pointed strings.

*dev* is the device name.

## SEE ALSO

[**libnutclient**(3)](/libnutclient/3.md)
