diff --git a/os/utils.c b/os/utils.c index df56b5b9b..c1e280b35 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1406,7 +1406,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;