diff --git a/os/utils.c b/os/utils.c index 57c21a448..8963b53a0 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1215,7 +1215,9 @@ Fopen(const char *file, const char *type) iop = fopen(file, type); if (seteuid(euid) == -1) { - fclose(iop); + if (iop) { + fclose(iop); + } return NULL; } return iop;