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


apps/speed.c:1787:1: start of procedure do_multi()
1785.   
1786.   #ifdef HAVE_FORK
1787. > static int do_multi(int multi)
1788.   	{
1789.   	int n;

apps/speed.c:1792:2: 
1790.   	int fd[2];
1791.   	int *fds;
1792. > 	static char sep[]=":";
1793.   
1794.   	fds=malloc(multi*sizeof *fds);

apps/speed.c:1794:2: 
1792.   	static char sep[]=":";
1793.   
1794. > 	fds=malloc(multi*sizeof *fds);
1795.   	for(n=0 ; n < multi ; ++n)
1796.   		{

apps/speed.c:1795:6: 
1793.   
1794.   	fds=malloc(multi*sizeof *fds);
1795. > 	for(n=0 ; n < multi ; ++n)
1796.   		{
1797.   		pipe(fd);

apps/speed.c:1795:12: Loop condition is false. Leaving loop
1793.   
1794.   	fds=malloc(multi*sizeof *fds);
1795.   	for(n=0 ; n < multi ; ++n)
                   ^
1796.   		{
1797.   		pipe(fd);

apps/speed.c:1817:6: 
1815.   
1816.   	/* for now, assume the pipe is long enough to take all the output */
1817. > 	for(n=0 ; n < multi ; ++n)
1818.   		{
1819.   		FILE *f;

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

apps/speed.c:1823:3: 
1821.   		char *p;
1822.   
1823. > 		f=fdopen(fds[n],"r");
1824.   		while(fgets(buf,sizeof buf,f))
1825.   			{

apps/speed.c:1824:9: 
1822.   
1823.   		f=fdopen(fds[n],"r");
1824. > 		while(fgets(buf,sizeof buf,f))
1825.   			{
1826.   			p=strchr(buf,'\n');
