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


apps/speed.c:2557:1: start of procedure do_multi()
2555.   
2556.   #ifdef HAVE_FORK
2557. > static int do_multi(int multi)
2558.   	{
2559.   	int n;

apps/speed.c:2562:2: 
2560.   	int fd[2];
2561.   	int *fds;
2562. > 	static char sep[]=":";
2563.   
2564.   	fds=malloc(multi*sizeof *fds);

apps/speed.c:2564:2: 
2562.   	static char sep[]=":";
2563.   
2564. > 	fds=malloc(multi*sizeof *fds);
2565.   	for(n=0 ; n < multi ; ++n)
2566.   		{

apps/speed.c:2565:6: 
2563.   
2564.   	fds=malloc(multi*sizeof *fds);
2565. > 	for(n=0 ; n < multi ; ++n)
2566.   		{
2567.   		pipe(fd);

apps/speed.c:2565:12: Loop condition is false. Leaving loop
2563.   
2564.   	fds=malloc(multi*sizeof *fds);
2565.   	for(n=0 ; n < multi ; ++n)
                   ^
2566.   		{
2567.   		pipe(fd);

apps/speed.c:2587:6: 
2585.   
2586.   	/* for now, assume the pipe is long enough to take all the output */
2587. > 	for(n=0 ; n < multi ; ++n)
2588.   		{
2589.   		FILE *f;

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

apps/speed.c:2593:3: 
2591.   		char *p;
2592.   
2593. > 		f=fdopen(fds[n],"r");
2594.   		while(fgets(buf,sizeof buf,f))
2595.   			{

apps/speed.c:2594:9: 
2592.   
2593.   		f=fdopen(fds[n],"r");
2594. > 		while(fgets(buf,sizeof buf,f))
2595.   			{
2596.   			p=strchr(buf,'\n');
