src/common/map.c
// Destroys a map and it's entries
//
// Note: If the value stored in the entires has nested items which need to be
// free'd then there will be memory leaks if this function is used since we are
// only dealing with the top level. map_destroy_func allows for customizing the
// free'ing of entries
Destroys a map and it's entries
Note: If the value stored in the entires has nested items which need to be
free'd then there will be memory leaks if this function is used since we are
only dealing with the top level. map_destroy_func allows for customizing the
free'ing of entries
Destroys a map and it ' s entries Note : If the value stored in the entires has nested items which need to be free ' d then there will be memory leaks if this function is used since we are only dealing with the top level . map_destroy_func allows for customizing the free ' ing of entries
void map_destroy(struct map *map)
{
        if (map == NULL) {
                return;
        }
        for (size_t i = 0; i < map->length; ++i) {
                map_entry_destroy(map, map->entries[i]);
        }
        free(map->entries);
        free(map);
}
void map_destroy ( struct map * map ) { if ( map == NULL ) { return ; } for ( size_t i = 0 ; i < map -> length ; ++ i ) { map_entry_destroy ( map , map -> entries [ i ] ) ; } free ( map -> entries ) ; free ( map ) ; }
Destroys a map and it's entries
Note: If the value stored in the entires has nested items which need to be
free'd then there will be memory leaks if this function is used since we are
only dealing with the top level.
Destroys a map and it ' s entries Note : If the value stored in the entires has nested items which need to be free ' d then there will be memory leaks if this function is used since we are only dealing with the top level .
// Delete entries