---
name: "g2_free.c"
section: "3"
platform: "linux"
package: "libg2c-dev"
version: "2.1.0-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/g2_free.c"
---

# g2\_free.c(3)

Free up memory that was allocated for struct gribfield.

## NAME

g2\_free.c - Free up memory that was allocated for struct **gribfield**.

## SYNOPSIS

`#include 'grib2_int.h'`\
 `#include <stdlib.h>`\

### Functions

void **g2\_free** (**gribfield** \*gfld)\
 Free memory that was allocated for struct **gribfield**.

## Detailed Description

Free up memory that was allocated for struct **gribfield**.

**Author**

Stephen Gilbeert

**Date**

2002-10-28

Definition in file **g2\_free.c**.

## Function Documentation

### void g2\_free (gribfield \* gfld)

Free memory that was allocated for struct **gribfield**.

**Parameters**

*gfld* pointer to **gribfield** structure (defined in include file **grib2.h**) returned from routine **g2\_getfld()**.

**Note**

This routine must be called to free up memory used by the decode routine, **g2\_getfld()**, when user no longer needs to reference this data.

**Author**

Stephen Gilbeert

**Date**

2002-10-28

Definition at line **23** of file **g2\_free.c**.

References **gribfield::bmap**, **gribfield::coord\_list**, **gribfield::fld**, **gribfield::idrtmpl**, **gribfield::idsect**, **gribfield::igdtmpl**, **gribfield::ipdtmpl**, **gribfield::list\_opt**, and **gribfield::local**.

Referenced by **g2\_getfld()**.

## Author

Generated automatically by Doxygen for NCEPLIBS-g2c from the source code.
