From 496e97b8dc2337de19ad62323f2c62495b5edc19 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 17 Sep 2012 10:53:46 -0400 Subject: [PATCH] Avoid calling fclose(NULL) in the error path when we cannot open an I/O log file. --HG-- branch : 1.8 --- plugins/sudoers/sudoreplay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/sudoreplay.c b/plugins/sudoers/sudoreplay.c index 2abbf1b7c..a61c0f5c2 100644 --- a/plugins/sudoers/sudoreplay.c +++ b/plugins/sudoers/sudoreplay.c @@ -884,7 +884,8 @@ parse_logfile(char *logfile) debug_return_ptr(li); bad: - fclose(fp); + if (fp != NULL) + fclose(fp); efree(buf); free_log_info(li); debug_return_ptr(NULL); -- 2.40.0