TRQ-1880. Fix a core dump when freeing a stack variable.