diff --git a/os/utils.c b/os/utils.c index f0d022fba..8558bbe86 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1599,7 +1599,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;