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


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

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

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

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

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

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

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

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

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