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


apps/speed.c:2546:1: start of procedure do_multi()
2544.   }
2545.   
2546. > static int do_multi(int multi)
2547.   {
2548.       int n;

apps/speed.c:2551:5: 
2549.       int fd[2];
2550.       int *fds;
2551. >     static char sep[] = ":";
2552.   
2553.       fds = malloc(multi * sizeof *fds);

apps/speed.c:2553:5: 
2551.       static char sep[] = ":";
2552.   
2553. >     fds = malloc(multi * sizeof *fds);
2554.       for (n = 0; n < multi; ++n) {
2555.           if (pipe(fd) == -1) {

apps/speed.c:2554:10: 
2552.   
2553.       fds = malloc(multi * sizeof *fds);
2554. >     for (n = 0; n < multi; ++n) {
2555.           if (pipe(fd) == -1) {
2556.               fprintf(stderr, "pipe failure\n");

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

apps/speed.c:2555:13: Taking false branch
2553.       fds = malloc(multi * sizeof *fds);
2554.       for (n = 0; n < multi; ++n) {
2555.           if (pipe(fd) == -1) {
                    ^
2556.               fprintf(stderr, "pipe failure\n");
2557.               exit(1);

apps/speed.c:2559:9: 
2557.               exit(1);
2558.           }
2559. >         fflush(stdout);
2560.           fflush(stderr);
2561.           if (fork()) {

apps/speed.c:2560:9: 
2558.           }
2559.           fflush(stdout);
2560. >         fflush(stderr);
2561.           if (fork()) {
2562.               close(fd[1]);

apps/speed.c:2561:13: Taking true branch
2559.           fflush(stdout);
2560.           fflush(stderr);
2561.           if (fork()) {
                    ^
2562.               close(fd[1]);
2563.               fds[n] = fd[0];

apps/speed.c:2562:13: 
2560.           fflush(stderr);
2561.           if (fork()) {
2562. >             close(fd[1]);
2563.               fds[n] = fd[0];
2564.           } else {

apps/speed.c:2563:13: 
2561.           if (fork()) {
2562.               close(fd[1]);
2563. >             fds[n] = fd[0];
2564.           } else {
2565.               close(fd[0]);
