---
name: "freechain"
section: "3"
platform: "linux"
package: "alliance"
version: "5.1.1-3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/freechain"
---

# freechain(3)

free a chain\_list

## NAME

freechain - free a **chain\_list**

## SYNOPSYS

```
#include "mut.h"
void freechain(pt)
chain_list ∗pt;
```

## PARAMETER

- *pt*

  Pointer to the **chain** list to be freed

## DESCRIPTION

**freechain** frees the **chain\_list** pointed to by *pt*. All the elements of the list are put back in the list of free blocks.

## EXAMPLE

```
#include "mut.h"
void free_from(c, i) /∗ erase list from ith element ∗/
chain_list ∗c;
int i;
{
chain_list ∗t;
	while (i--)
		c = c->NEXT;
	t = c->NEXT, c->NEXT = NULL;
	freechain(t);
}
```

## SEE ALSO

**mbk**(1), [**chain**(3)](/chain/3.md), [**addchain**(3)](/addchain/3.md), [**delchain**(3)](/delchain/3.md).
