[DF-4077] fix mem leaks