From e8ba5b23cf2677cb1f9ae407be22304778b5a489 Mon Sep 17 00:00:00 2001 From: "Stiliyan Tonev (Bark)" Date: Fri, 30 Aug 2024 14:07:00 +0300 Subject: [PATCH] Handle case where log file is not set. --- libfreshclam/libfreshclam.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libfreshclam/libfreshclam.c b/libfreshclam/libfreshclam.c index 49b9819e60..e99257d080 100644 --- a/libfreshclam/libfreshclam.c +++ b/libfreshclam/libfreshclam.c @@ -125,6 +125,9 @@ const char *fc_strerror(fc_error_t fcerror) int fc_upsert_logg_file(fc_config *fcConfig) { + if (fcConfig->logFile == NULL) { + return 0; + } int ret = 0, field_no = 1; char *current_path, *file_path = cli_safer_strdup(fcConfig->logFile), *token; FILE *logg_fp = NULL;