NULL check before setting the fd?