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


apps/speed.c:1683:1: start of procedure do_multi()
1681.   
1682.   #ifdef HAVE_FORK
1683. > static int do_multi(int multi)
1684.   	{
1685.   	int n;

apps/speed.c:1688:2: 
1686.   	int fd[2];
1687.   	int *fds;
1688. > 	static char sep[]=":";
1689.   
1690.   	fds=malloc(multi*sizeof *fds);

apps/speed.c:1690:2: 
1688.   	static char sep[]=":";
1689.   
1690. > 	fds=malloc(multi*sizeof *fds);
1691.   	for(n=0 ; n < multi ; ++n)
1692.   		{

apps/speed.c:1691:6: 
1689.   
1690.   	fds=malloc(multi*sizeof *fds);
1691. > 	for(n=0 ; n < multi ; ++n)
1692.   		{
1693.   		pipe(fd);

apps/speed.c:1691:12: Loop condition is false. Leaving loop
1689.   
1690.   	fds=malloc(multi*sizeof *fds);
1691.   	for(n=0 ; n < multi ; ++n)
                   ^
1692.   		{
1693.   		pipe(fd);

apps/speed.c:1713:6: 
1711.   
1712.   	/* for now, assume the pipe is long enough to take all the output */
1713. > 	for(n=0 ; n < multi ; ++n)
1714.   		{
1715.   		FILE *f;

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

apps/speed.c:1719:3: 
1717.   		char *p;
1718.   
1719. > 		f=fdopen(fds[n],"r");
1720.   		while(fgets(buf,sizeof buf,f))
1721.   			{

apps/speed.c:1720:9: 
1718.   
1719.   		f=fdopen(fds[n],"r");
1720. > 		while(fgets(buf,sizeof buf,f))
1721.   			{
1722.   			p=strchr(buf,'\n');
