double free error in data structures