Commit Diff
--- vias.c +++ vias.c @@ -229,7 +229,7 @@ permit(uid_t uid, gid_t *groups, int ngroups, struct r } } if (*lastr == NULL || (*lastr)->action != PERMIT) { - if (close(fd) == -1) + if (fd != -1 && close(fd) == -1) err(1, "close"); return -1; }