| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

 

strfree

#include "sflstr.h"
char **
strfree (
    char **string)

Synopsis

Releases memory occupied by a string. Call this function only when you previously allocated the string using malloc or strdupl(). You pass the address of a char pointer; this function sets the pointer to NULL. This is a safety measure meant to make it safe to try to free non-allocated strings. In your code, initialise all such pointers to NULL. Returns the address of the modified pointer.

Source Code - (sflstr.c)

{
    ASSERT (string);
    if (string && *string)
      {
        free (*string);
        *string = NULL;
      }
    return (string);
}

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation