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


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

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

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

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

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

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

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

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

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