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


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

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

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

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

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

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

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

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

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