5.6.3 Releasing Memory for a Variable Length Array (VLEN) Type: NF_FREE_VLEN
When a VLEN is read into user memory from the file, the HDF5 library
performs memory allocations for each of the variable length arrays
contained within the VLEN structure. This memory must be freed by the
user to avoid memory leaks.
This violates the normal netCDF expectation that the user is
responsible for all memory allocation. But, with VLEN arrays, the
underlying HDF5 library allocates the memory for the user, and the user
is responsible for deallocating that memory.
Usage
INTEGER FUNCTION NF_FREE_VLEN(CHARACTER VL);
VL- The variable length array structure which is to be freed.
Errors
NF_NOERR- No error.
NF_EBADTYPE- Can't find the typeid.
Example