diff --git a/src/naemon/commands.c b/src/naemon/commands.c index 8416d32e..478e8c10 100644 --- a/src/naemon/commands.c +++ b/src/naemon/commands.c @@ -183,7 +183,8 @@ int close_command_file(void) command_file_created = FALSE; /* close the command file */ - fclose(command_file_fp); + if (command_file_fp != NULL) + fclose(command_file_fp); return OK; }