TS-1475: Fix bug where pointer is freed and doesn't set it to NULL. Coverity #1196490