beautypg.com

Free_varbind_data – Compaq AAR04BCTE User Manual

Page 114

background image

eSNMP API Routines
free_varbind_data

free_varbind_data

Frees the dynamically allocated fields in the VARBIND structure. However, this
routine does not deallocate the VARBIND structure itself; it deallocates the name
and data buffers to which the VARBIND structure points.

Format

void free_varbind_data ( varbind *vb );

Description

This routine performs a

free_oid

(vb->name) operation. If indicated by the

vb->type field, it then frees the vb->value data using either the

free_oct

or the

free_oid

routine.

Example

#include
VARBIND *vb;

vb = (VARBIND*)malloc(sizeof(VARBIND));
clone_oid(&vb->name,oid);
clone_oct(&vb->value.oct,data);
:
: some processing that uses vb occurs here
:
free_varbind_data(vb);
free(vb);

5–56 eSNMP API Routines