DF-1938. Fix memory leak