DF-2251. Fix memory leak