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


apps/speed.c:2397:1: start of procedure do_multi()
2395.   
2396.   #ifdef HAVE_FORK
2397. > static int do_multi(int multi)
2398.   	{
2399.   	int n;

apps/speed.c:2402:2: 
2400.   	int fd[2];
2401.   	int *fds;
2402. > 	static char sep[]=":";
2403.   
2404.   	fds=malloc(multi*sizeof *fds);

apps/speed.c:2404:2: 
2402.   	static char sep[]=":";
2403.   
2404. > 	fds=malloc(multi*sizeof *fds);
2405.   	for(n=0 ; n < multi ; ++n)
2406.   		{

apps/speed.c:2405:6: 
2403.   
2404.   	fds=malloc(multi*sizeof *fds);
2405. > 	for(n=0 ; n < multi ; ++n)
2406.   		{
2407.   		pipe(fd);

apps/speed.c:2405:12: Loop condition is false. Leaving loop
2403.   
2404.   	fds=malloc(multi*sizeof *fds);
2405.   	for(n=0 ; n < multi ; ++n)
                   ^
2406.   		{
2407.   		pipe(fd);

apps/speed.c:2427:6: 
2425.   
2426.   	/* for now, assume the pipe is long enough to take all the output */
2427. > 	for(n=0 ; n < multi ; ++n)
2428.   		{
2429.   		FILE *f;

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

apps/speed.c:2433:3: 
2431.   		char *p;
2432.   
2433. > 		f=fdopen(fds[n],"r");
2434.   		while(fgets(buf,sizeof buf,f))
2435.   			{

apps/speed.c:2434:9: 
2432.   
2433.   		f=fdopen(fds[n],"r");
2434. > 		while(fgets(buf,sizeof buf,f))
2435.   			{
2436.   			p=strchr(buf,'\n');
