Don't close a random fd
Don't close a random fd

if (f->rxstate == TRANSFER_INPROGRESS &&
    (fd = openat(f->dirfd, ffiles[FFILE_OUT].name, ffiles[FFILE_OUT].flags, 0666)) == -1 &&
    errno == ENXIO) {
    ...
} else {
    close(fd); <--- not always appropriate!
}

pranomostro/ratox,insanity54/batox,kytvi2p/ratox,cmotc/ratox,cmotc/ratox,pranomostro/ratox