apps/speed.c:1845: error: NULL_DEREFERENCE
  pointer `f` last assigned on line 1844 could be null and is dereferenced by call to `fgets()` at line 1845, column 9.
Showing all 9 steps of the trace


apps/speed.c:1808:1: start of procedure do_multi()
1806.   
1807.   #ifdef HAVE_FORK
1808. > static int do_multi(int multi)
1809.   	{
1810.   	int n;

apps/speed.c:1813:2: 
1811.   	int fd[2];
1812.   	int *fds;
1813. > 	static char sep[]=":";
1814.   
1815.   	fds=malloc(multi*sizeof *fds);

apps/speed.c:1815:2: 
1813.   	static char sep[]=":";
1814.   
1815. > 	fds=malloc(multi*sizeof *fds);
1816.   	for(n=0 ; n < multi ; ++n)
1817.   		{

apps/speed.c:1816:6: 
1814.   
1815.   	fds=malloc(multi*sizeof *fds);
1816. > 	for(n=0 ; n < multi ; ++n)
1817.   		{
1818.   		pipe(fd);

apps/speed.c:1816:12: Loop condition is false. Leaving loop
1814.   
1815.   	fds=malloc(multi*sizeof *fds);
1816.   	for(n=0 ; n < multi ; ++n)
                   ^
1817.   		{
1818.   		pipe(fd);

apps/speed.c:1838:6: 
1836.   
1837.   	/* for now, assume the pipe is long enough to take all the output */
1838. > 	for(n=0 ; n < multi ; ++n)
1839.   		{
1840.   		FILE *f;

apps/speed.c:1838:12: Loop condition is true. Entering loop body
1836.   
1837.   	/* for now, assume the pipe is long enough to take all the output */
1838.   	for(n=0 ; n < multi ; ++n)
                   ^
1839.   		{
1840.   		FILE *f;

apps/speed.c:1844:3: 
1842.   		char *p;
1843.   
1844. > 		f=fdopen(fds[n],"r");
1845.   		while(fgets(buf,sizeof buf,f))
1846.   			{

apps/speed.c:1845:9: 
1843.   
1844.   		f=fdopen(fds[n],"r");
1845. > 		while(fgets(buf,sizeof buf,f))
1846.   			{
1847.   			p=strchr(buf,'\n');
