ovsdb_symbol_table_destroy(struct ovsdb_symbol_table *symtab)
{
if (symtab) {
- struct shash_node *node, *next;
-
- SHASH_FOR_EACH_SAFE (node, next, &symtab->sh) {
- struct ovsdb_symbol *symbol = node->data;
- free(symbol);
- shash_delete(&symtab->sh, node);
- }
- shash_destroy(&symtab->sh);
+ shash_destroy_free_data(&symtab->sh);
free(symtab);
}
}
}
shash_destroy(&info->bridges);
- SHASH_FOR_EACH (node, &info->ports) {
- struct vsctl_port *port = node->data;
- free(port);
- }
- shash_destroy(&info->ports);
-
- SHASH_FOR_EACH (node, &info->ifaces) {
- struct vsctl_iface *iface = node->data;
- free(iface);
- }
- shash_destroy(&info->ifaces);
+ shash_destroy_free_data(&info->ports);
+ shash_destroy_free_data(&info->ifaces);
}
static void
set_up_iface(const struct ovsrec_interface *iface_cfg, struct iface *iface,
bool create)
{
- struct shash_node *node;
struct shash options;
int error = 0;
size_t i;
error = EINVAL;
}
}
-
- SHASH_FOR_EACH (node, &options) {
- free(node->data);
- }
- shash_destroy(&options);
+ shash_destroy_free_data(&options);
return error;
}