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


apps/speed.c:2458:1: start of procedure do_multi()
2456.   
2457.   #ifdef HAVE_FORK
2458. > static int do_multi(int multi)
2459.   	{
2460.   	int n;

apps/speed.c:2463:2: 
2461.   	int fd[2];
2462.   	int *fds;
2463. > 	static char sep[]=":";
2464.   
2465.   	fds=malloc(multi*sizeof *fds);

apps/speed.c:2465:2: 
2463.   	static char sep[]=":";
2464.   
2465. > 	fds=malloc(multi*sizeof *fds);
2466.   	for(n=0 ; n < multi ; ++n)
2467.   		{

apps/speed.c:2466:6: 
2464.   
2465.   	fds=malloc(multi*sizeof *fds);
2466. > 	for(n=0 ; n < multi ; ++n)
2467.   		{
2468.   		pipe(fd);

apps/speed.c:2466:12: Loop condition is false. Leaving loop
2464.   
2465.   	fds=malloc(multi*sizeof *fds);
2466.   	for(n=0 ; n < multi ; ++n)
                   ^
2467.   		{
2468.   		pipe(fd);

apps/speed.c:2488:6: 
2486.   
2487.   	/* for now, assume the pipe is long enough to take all the output */
2488. > 	for(n=0 ; n < multi ; ++n)
2489.   		{
2490.   		FILE *f;

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

apps/speed.c:2494:3: 
2492.   		char *p;
2493.   
2494. > 		f=fdopen(fds[n],"r");
2495.   		while(fgets(buf,sizeof buf,f))
2496.   			{

apps/speed.c:2495:9: 
2493.   
2494.   		f=fdopen(fds[n],"r");
2495. > 		while(fgets(buf,sizeof buf,f))
2496.   			{
2497.   			p=strchr(buf,'\n');
