summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorStelios Fragkakis <52996999+stelfrag@users.noreply.github.com>2023-12-27 10:56:15 +0200
committerGitHub <noreply@github.com>2023-12-27 10:56:15 +0200
commit0cc327f9fc6f9425c22b56497f4739e47a9d714a (patch)
treec31e1ca8e3557115eb7cfd48395bc12422f8d66f /collectors
parent28ef0540ed2cb049eb069adb4d6e020d52d0443a (diff)
Fix coverity issues (#16655)
Diffstat (limited to 'collectors')
-rw-r--r--collectors/log2journal/log2journal-replace.c2
-rw-r--r--collectors/log2journal/log2journal-yaml.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/collectors/log2journal/log2journal-replace.c b/collectors/log2journal/log2journal-replace.c
index 429d615da5..7075d109dd 100644
--- a/collectors/log2journal/log2journal-replace.c
+++ b/collectors/log2journal/log2journal-replace.c
@@ -74,6 +74,7 @@ bool replace_pattern_set(REPLACE_PATTERN *rp, const char *pattern) {
log2stderr("Error: Failed to add replacement node for variable.");
return false;
}
+ freez(variable_name);
current = end + 1; // Move past the variable
}
@@ -97,6 +98,7 @@ bool replace_pattern_set(REPLACE_PATTERN *rp, const char *pattern) {
log2stderr("Error: Failed to add replacement node for text.");
return false;
}
+ freez(text);
}
}
diff --git a/collectors/log2journal/log2journal-yaml.c b/collectors/log2journal/log2journal-yaml.c
index 862e7bf4b7..2a0da81df8 100644
--- a/collectors/log2journal/log2journal-yaml.c
+++ b/collectors/log2journal/log2journal-yaml.c
@@ -561,6 +561,8 @@ static size_t yaml_parse_rewrites(yaml_parser_t *parser, LOG_JOB *jb) {
yaml_event_delete(&sub_event);
}
+ freez(replace_pattern);
+ replace_pattern = NULL;
}
break;