[DF-3888] Prevent memory leak