From c286f17c9743403c50be45b98f99a0be486b062f Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 18 Sep 2012 10:02:13 -0400 Subject: [PATCH] Avoid calling fclose(NULL) in the error path when we cannot open an I/O log file. --HG-- branch : 1.7 --- sudoreplay.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sudoreplay.c b/sudoreplay.c index 1e16a8222..153ab11b6 100644 --- a/sudoreplay.c +++ b/sudoreplay.c @@ -867,7 +867,8 @@ parse_logfile(logfile) return li; bad: - fclose(fp); + if (fp != NULL) + fclose(fp); efree(buf); free_log_info(li); return NULL; -- 2.40.0