The mi_error_desc_destroy() function

The mi_error_desc_destroy() function frees an error descriptor that the mi_error_desc_copy() function allocated.

Syntax

mi_integer mi_error_desc_destroy(err_desc)
   MI_ERROR_DESC *err_desc;
err_desc
A pointer to the error descriptor to free.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_error_desc_destroy() function is a destructor function for the error descriptor. It frees the error descriptor that err_desc references. The mi_error_desc_copy() function must previously have allocated the err_desc error descriptor. This function can fail if either of the following error conditions exists:
  • The err_desc structure is not a valid MI_ERROR_DESC structure.
  • The err_desc structure is internally managed (it was not created by the mi_error_desc_copy() function) and therefore cannot be freed by the user.

Use the mi_error_desc_is_copy() function to determine how the err_desc structure was allocated.

For a general discussion of how to release a copy of an error descriptor, see the Informix® DataBlade® API Programmer's Guide.

Return values

MI_OK
The function was successful.
MI_ERROR
The function was not successful.