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


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

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

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

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

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

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

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

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

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