FreeBSD/usr.bin/grep/regex/hashtable.c
/*
 * Frees the resources associated with the hash table tbl.
 */
Frees the resources associated with the hash table tbl.
Frees the resources associated with the hash table tbl .
void
hashtable_free(hashtable *tbl)
{
  if (tbl == NULL)
    return;
  for (unsigned int i = 0; i < tbl->table_size; i++)
    if ((tbl->entries[i] != NULL))
      {
	free(tbl->entries[i]->key);
	free(tbl->entries[i]->value);
      }
  free(tbl->entries);
  DPRINT(("hashtable_free: resources are successfully freed\n"));
}
void hashtable_free ( hashtable * tbl ) { if ( tbl == NULL ) return ; for ( unsigned int i = 0 ; i < tbl -> table_size ; i ++ ) if ( ( tbl -> entries [ i ] != NULL ) ) { free ( tbl -> entries [ i ] -> key ) ; free ( tbl -> entries [ i ] -> value ) ; } free ( tbl -> entries ) ; DPRINT ( ( " \n " ) ) ; }
Frees the resources associated with the hash table tbl.
Frees the resources associated with the hash table tbl .