Whoops, was freeing the same memory twice.