log: can use a file set from env variable

Enables the redirection of log to a file set by an environment
variable SC_LOG_FILE when SC_LOG_OP_IFACE=file
pull/4550/head
Philippe Antoine 6 years ago committed by Victor Julien
parent 2456f27d08
commit 12a3a24906

@ -707,7 +707,7 @@ static inline SCLogOPIfaceCtx *SCLogInitFileOPIface(const char *file,
exit(EXIT_FAILURE);
}
if (file == NULL || log_format == NULL) {
if (file == NULL) {
goto error;
}
@ -723,7 +723,7 @@ static inline SCLogOPIfaceCtx *SCLogInitFileOPIface(const char *file,
goto error;
}
if ((iface_ctx->log_format = SCStrdup(log_format)) == NULL) {
if (log_format != NULL && (iface_ctx->log_format = SCStrdup(log_format)) == NULL) {
goto error;
}

Loading…
Cancel
Save