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


apps/speed.c:2438:1: start of procedure do_multi()
2436.   
2437.   #ifdef HAVE_FORK
2438. > static int do_multi(int multi)
2439.   	{
2440.   	int n;

apps/speed.c:2443:2: 
2441.   	int fd[2];
2442.   	int *fds;
2443. > 	static char sep[]=":";
2444.   
2445.   	fds=malloc(multi*sizeof *fds);

apps/speed.c:2445:2: 
2443.   	static char sep[]=":";
2444.   
2445. > 	fds=malloc(multi*sizeof *fds);
2446.   	for(n=0 ; n < multi ; ++n)
2447.   		{

apps/speed.c:2446:6: 
2444.   
2445.   	fds=malloc(multi*sizeof *fds);
2446. > 	for(n=0 ; n < multi ; ++n)
2447.   		{
2448.   		pipe(fd);

apps/speed.c:2446:12: Loop condition is false. Leaving loop
2444.   
2445.   	fds=malloc(multi*sizeof *fds);
2446.   	for(n=0 ; n < multi ; ++n)
                   ^
2447.   		{
2448.   		pipe(fd);

apps/speed.c:2468:6: 
2466.   
2467.   	/* for now, assume the pipe is long enough to take all the output */
2468. > 	for(n=0 ; n < multi ; ++n)
2469.   		{
2470.   		FILE *f;

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

apps/speed.c:2474:3: 
2472.   		char *p;
2473.   
2474. > 		f=fdopen(fds[n],"r");
2475.   		while(fgets(buf,sizeof buf,f))
2476.   			{

apps/speed.c:2475:9: 
2473.   
2474.   		f=fdopen(fds[n],"r");
2475. > 		while(fgets(buf,sizeof buf,f))
2476.   			{
2477.   			p=strchr(buf,'\n');
