From: Todd C. Miller Date: Mon, 17 Sep 2012 14:53:46 +0000 (-0400) Subject: Avoid calling fclose(NULL) in the error path when we cannot open an X-Git-Tag: SUDO_1_8_7~1^2~391 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=37d70a999cd8f0858487f04d7b83d68d61dbf273;p=sudo Avoid calling fclose(NULL) in the error path when we cannot open an I/O log file. --- 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);