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


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

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

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

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

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

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

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

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

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