lib/cfg_parse.c
/**
 * This function deletes an entire cfg_struct, clearing any memory
 * previously held by the structure.
 * @param cfg Pointer to cfg_struct to delete.
 */
This function deletes an entire cfg_struct, clearing any memory
previously held by the structure.
@param cfg Pointer to cfg_struct to delete.
This function deletes an entire cfg_struct clearing any memory previously held by the structure . @param cfg Pointer to cfg_struct to delete .
void cfg_free(struct cfg_struct *cfg)
{
  struct cfg_node *temp = NULL, *temp2;
  temp = cfg->head;
  while (temp != NULL)
  {
    temp2 = temp->next;
    free(temp->key);
    free(temp->value);
    free(temp);
    temp = temp2;
  }
  free (cfg);
}
void cfg_free ( struct cfg_struct * cfg ) { struct cfg_node * temp = NULL , * temp2 ; temp = cfg -> head ; while ( temp != NULL ) { temp2 = temp -> next ; free ( temp -> key ) ; free ( temp -> value ) ; free ( temp ) ; temp = temp2 ; } free ( cfg ) ; }
This function deletes an entire cfg_struct, clearing any memory
 previously held by the structure.
This function deletes an entire cfg_struct clearing any memory previously held by the structure .