srv_free

Description

Free previously allocated memory.

Syntax

CS_RETCODE srv_free(mp)
CS_VOID            *mp;

Parameters

mp

A pointer to the memory to be freed.

Returns

Table 3-46: Return values (srv_free)

Returns

To indicate

CS_SUCCEED

The routine completed successfully.

CS_FAIL

The routine failed.

Examples

Example 1

#include  <ospublic.h>
/*
 ** Local Prototype
 */
CS_RETCODE ex_srv_free PROTOTYPE((
CS_BYTE   *p
));
/* 
 ** EX_SRV_FREE
**
**   Example routine to free memory allocated through srv_alloc.
**
** Arguments:
**        p - The address of the memory block to be freed.
**
** Returns:
**
**   CS_SUCCEED      Memory was freed successfully.
**   CS_FAIL         An error was detected.
*/
CS_RETCODE     ex_srv_free(p)
CS_BYTE        *p;
{
    /*
    ** Free the memory block.
    */
    if( srv_free(p) == CS_FAIL )
    {
        return CS_FAIL;
    }
    return CS_SUCCEED;
}

Usage

See also

srv_alloc, srv_props, srv_realloc, srv_init