log: add NULL ptr guard on fclose when reopening.

Signed-off-by: Emmanuel Roullit <emmanuel.roullit@cognitix.de>
pull/3772/head
Emmanuel Roullit 6 years ago committed by Victor Julien
parent f84667ceb7
commit 4b4bb31c30

@ -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. */

Loading…
Cancel
Save