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


apps/speed.c:2540:1: start of procedure do_multi()
2538.   
2539.   #ifdef HAVE_FORK
2540. > static int do_multi(int multi)
2541.   	{
2542.   	int n;

apps/speed.c:2545:2: 
2543.   	int fd[2];
2544.   	int *fds;
2545. > 	static char sep[]=":";
2546.   
2547.   	fds=malloc(multi*sizeof *fds);

apps/speed.c:2547:2: 
2545.   	static char sep[]=":";
2546.   
2547. > 	fds=malloc(multi*sizeof *fds);
2548.   	for(n=0 ; n < multi ; ++n)
2549.   		{

apps/speed.c:2548:6: 
2546.   
2547.   	fds=malloc(multi*sizeof *fds);
2548. > 	for(n=0 ; n < multi ; ++n)
2549.   		{
2550.   		pipe(fd);

apps/speed.c:2548:12: Loop condition is false. Leaving loop
2546.   
2547.   	fds=malloc(multi*sizeof *fds);
2548.   	for(n=0 ; n < multi ; ++n)
                   ^
2549.   		{
2550.   		pipe(fd);

apps/speed.c:2570:6: 
2568.   
2569.   	/* for now, assume the pipe is long enough to take all the output */
2570. > 	for(n=0 ; n < multi ; ++n)
2571.   		{
2572.   		FILE *f;

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

apps/speed.c:2576:3: 
2574.   		char *p;
2575.   
2576. > 		f=fdopen(fds[n],"r");
2577.   		while(fgets(buf,sizeof buf,f))
2578.   			{

apps/speed.c:2577:9: 
2575.   
2576.   		f=fdopen(fds[n],"r");
2577. > 		while(fgets(buf,sizeof buf,f))
2578.   			{
2579.   			p=strchr(buf,'\n');
