[Olena-patches] 1882: Address memory leaks in graphs.