pike.git / src / modules / _Stdio / file.c

version» Context lines:

pike.git/src/modules/_Stdio/file.c:451: Inside #if defined(HAVE_PIKE_SEND_FD)
   for(i = other_fd_info[1] + 1, j = num_fds-1; j >= cnt; i--, j--) {    other_fd_info[j] = other_fd_info[i];    }    for(i = 2; i < cnt; i++) {    other_fd_info[i] = fd_info[i];    }    other_fd_info[1] = num_fds;    free(fd_info);    fd_info = other_fd_info;    } else { -  int *new_fd_info = malloc(num_fds * sizeof(int)); +  int *new_fd_info = calloc(num_fds, sizeof(int));    if (!new_fd_info) {    /* FIXME: Huston, we have a problem... */    Pike_fatal("Out of memory in send_fd().\n");    } else {    new_fd_info[0] = num_fds;    new_fd_info[1] = num_fds - 2;    cnt = fd_info[1] + 2;    for (i = 2; i < cnt; i++) {    new_fd_info[i] = fd_info[i];    }