Fix memory leak on DS restart with telemetry

This avoids an ASAN issue in the next commit. The test here is added for good-style but does not trigger ASAN.

Merge request reports

Loading