---
name: "mst_free"
section: "3"
platform: "linux"
package: "libmseed-doc"
version: "2.19.8-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mst_free"
---

# mst\_free(3)

Initializing and freeing MSTrace and MSTraceGroup structures

## NAME

mst\_init - Initializing and freeing MSTrace and MSTraceGroup structures

## SYNOPSIS

```
#include <libmseed.h>
MSTrace      *mst_init ( MSTrace *mst );
void        mst_free ( MSTrace **ppmst );
MSTraceGroup *mst_initgroup ( MSTraceGroup *mstg );
void        mst_freegroup ( MSTraceGroup **ppmstg );
```

## DESCRIPTION

**mst\_init** will initialize a MSTrace structure.  If the *mst* parameter is NULL a new structure will be allocated.  If the *mst* parameter is not NULL the structure will be cleared and any memory allocated for the MSTrace.datasamples and MSTrace.prvtptr members will be freed.

**mst\_free** will free all memory associated with a MSTrace structure and set the structure pointer (\**ppmst*) to 0.  This includes any memory pointed to by the *prvtptr* member of the MSTrace structure.

**mst\_initgroup** will initialize a MSTraceGroup structure.  If the *mstg* parameter is NULL a new structure will be allocated.  If the *mstg* parameter is not NULL the structure will be cleared and any all associated MSTrace structures will be freed.

**mst\_freegroup** will free all memory associated with a MSTraceGroup structure and set the structure pointer (\**ppmstg*) to 0.

## RETURN VALUES

**mst\_init** returns a pointer to the MSTrace structure initialized on success or NULL on error.

**mst\_initgroup** returns a pointer to the MSTraceGroup structure initialized on success or NULL on error.

## SEE ALSO

**[ms\_intro(3)](/ms_intro/3.md)**.

## AUTHOR

```
Chad Trabant
IRIS Data Management Center
```
