From: Todd C. Miller Date: Tue, 18 Sep 2012 14:02:13 +0000 (-0400) Subject: Avoid calling fclose(NULL) in the error path when we cannot open an X-Git-Tag: SUDO_1_7_10p3~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c286f17c9743403c50be45b98f99a0be486b062f;p=sudo Avoid calling fclose(NULL) in the error path when we cannot open an I/O log file. --HG-- branch : 1.7 --- 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;