After resources have been freed, bridge_list does not point to valid data any longer and hence has to be reset.
An alternative implementation would change the signature of free_bridges(bridge_t *bridge) to free_bridges(bridge_t **bridge) (analogously to add_bridge) and reset the parameter by side effect.
After resources have been freed, bridge_list does not point to valid data any longer and hence has to be reset.
An alternative implementation would change the signature of free_bridges(bridge_t *bridge) to free_bridges(bridge_t **bridge) (analogously to add_bridge) and reset the parameter by side effect.