diff --git a/os/utils.c b/os/utils.c index 79e2f13f6..82ad41933 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1516,7 +1516,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;