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


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

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

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

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

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

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

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

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

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