Corrected potential NULL dereference pointed out by analyzer.