The ifx_var_freevar() function

The ifx_var_freevar() function frees memory that has been allocated for the var binary and lvarchar pointer host variables.

Syntax

int fix_var_freevar(var_bin)
   var binary *var_bin;
var_bin
The address of the var binary or lvarchar pointer host variable.

Usage

Whenever you have a var binary or lvarchar pointer host variable, as shown in the following example, you must explicitly free memory that is allocated for it by using the ifx_var_freevar() function.
EXEC SQL var binary ‘polygon’ poly;
EXEC SQL lvarchar *c;
The following example illustrates the use of ifx_var_freevar(). You must explicitly free memory that has been allocated for var binary and lvarchar pointer host variables by using the ifx_var_freevar() function.
ifx_var_freevar(&poly);
ifx_var_freevar(&c);

If you do not use ifx_var_dealloc() to deallocate memory that has been allocated for the data buffer of the var binary host variable, ifx_var_freevar() will do so. It then frees the memory of the var binary and lvarchar pointer host variables. In the preceding example, after ifx_var_freevar() was called, poly and c would be set to null.

Return codes

0
The function was successful
<0
The function was not successful and the return value indicates the cause of the error