reference through null pointer and memory leak (related to ITS#7588)