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


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

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

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

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

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

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

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

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

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