From: Emmanuel Roullit Date: Thu, 28 Mar 2019 08:19:17 +0000 (+0100) Subject: log: add NULL ptr guard on fclose when reopening. X-Git-Tag: suricata-5.0.0-beta1~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b4bb31c30339caa2c6020a7ec14bea848ba5a5d;p=thirdparty%2Fsuricata.git log: add NULL ptr guard on fclose when reopening. Signed-off-by: Emmanuel Roullit --- diff --git a/src/util-logopenfile.c b/src/util-logopenfile.c index 2694aa11f7..f188bb908e 100644 --- a/src/util-logopenfile.c +++ b/src/util-logopenfile.c @@ -500,7 +500,9 @@ int SCConfLogReopen(LogFileCtx *log_ctx) return -1; } - fclose(log_ctx->fp); + if (log_ctx->fp != NULL) { + fclose(log_ctx->fp); + } /* Reopen the file. Append is forced in case the file was not * moved as part of a rotation process. */