Fix address memory leaks in add_edge_h().