Free d_h memory as soon as possible