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


apps/speed.c:2495:1: start of procedure do_multi()
2493.   
2494.   #ifdef HAVE_FORK
2495. > static int do_multi(int multi)
2496.   	{
2497.   	int n;

apps/speed.c:2500:2: 
2498.   	int fd[2];
2499.   	int *fds;
2500. > 	static char sep[]=":";
2501.   
2502.   	fds=malloc(multi*sizeof *fds);

apps/speed.c:2502:2: 
2500.   	static char sep[]=":";
2501.   
2502. > 	fds=malloc(multi*sizeof *fds);
2503.   	for(n=0 ; n < multi ; ++n)
2504.   		{

apps/speed.c:2503:6: 
2501.   
2502.   	fds=malloc(multi*sizeof *fds);
2503. > 	for(n=0 ; n < multi ; ++n)
2504.   		{
2505.   		pipe(fd);

apps/speed.c:2503:12: Loop condition is false. Leaving loop
2501.   
2502.   	fds=malloc(multi*sizeof *fds);
2503.   	for(n=0 ; n < multi ; ++n)
                   ^
2504.   		{
2505.   		pipe(fd);

apps/speed.c:2525:6: 
2523.   
2524.   	/* for now, assume the pipe is long enough to take all the output */
2525. > 	for(n=0 ; n < multi ; ++n)
2526.   		{
2527.   		FILE *f;

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

apps/speed.c:2531:3: 
2529.   		char *p;
2530.   
2531. > 		f=fdopen(fds[n],"r");
2532.   		while(fgets(buf,sizeof buf,f))
2533.   			{

apps/speed.c:2532:9: 
2530.   
2531.   		f=fdopen(fds[n],"r");
2532. > 		while(fgets(buf,sizeof buf,f))
2533.   			{
2534.   			p=strchr(buf,'\n');
