apps/speed.c:2558: error: NULL_DEREFERENCE
  pointer `fds` last assigned on line 2548 could be null and is dereferenced at line 2558, column 13.
Showing all 11 steps of the trace


apps/speed.c:2541:1: start of procedure do_multi()
2539.   }
2540.   
2541. > static int do_multi(int multi)
2542.   {
2543.       int n;

apps/speed.c:2546:5: 
2544.       int fd[2];
2545.       int *fds;
2546. >     static char sep[] = ":";
2547.   
2548.       fds = malloc(multi * sizeof *fds);

apps/speed.c:2548:5: 
2546.       static char sep[] = ":";
2547.   
2548. >     fds = malloc(multi * sizeof *fds);
2549.       for (n = 0; n < multi; ++n) {
2550.           if (pipe(fd) == -1) {

apps/speed.c:2549:10: 
2547.   
2548.       fds = malloc(multi * sizeof *fds);
2549. >     for (n = 0; n < multi; ++n) {
2550.           if (pipe(fd) == -1) {
2551.               fprintf(stderr, "pipe failure\n");

apps/speed.c:2549:17: Loop condition is true. Entering loop body
2547.   
2548.       fds = malloc(multi * sizeof *fds);
2549.       for (n = 0; n < multi; ++n) {
                        ^
2550.           if (pipe(fd) == -1) {
2551.               fprintf(stderr, "pipe failure\n");

apps/speed.c:2550:13: Taking false branch
2548.       fds = malloc(multi * sizeof *fds);
2549.       for (n = 0; n < multi; ++n) {
2550.           if (pipe(fd) == -1) {
                    ^
2551.               fprintf(stderr, "pipe failure\n");
2552.               exit(1);

apps/speed.c:2554:9: 
2552.               exit(1);
2553.           }
2554. >         fflush(stdout);
2555.           fflush(stderr);
2556.           if (fork()) {

apps/speed.c:2555:9: 
2553.           }
2554.           fflush(stdout);
2555. >         fflush(stderr);
2556.           if (fork()) {
2557.               close(fd[1]);

apps/speed.c:2556:13: Taking true branch
2554.           fflush(stdout);
2555.           fflush(stderr);
2556.           if (fork()) {
                    ^
2557.               close(fd[1]);
2558.               fds[n] = fd[0];

apps/speed.c:2557:13: 
2555.           fflush(stderr);
2556.           if (fork()) {
2557. >             close(fd[1]);
2558.               fds[n] = fd[0];
2559.           } else {

apps/speed.c:2558:13: 
2556.           if (fork()) {
2557.               close(fd[1]);
2558. >             fds[n] = fd[0];
2559.           } else {
2560.               close(fd[0]);
