diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2023-12-27 10:56:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-27 10:56:15 +0200 |
commit | 0cc327f9fc6f9425c22b56497f4739e47a9d714a (patch) | |
tree | c31e1ca8e3557115eb7cfd48395bc12422f8d66f /collectors | |
parent | 28ef0540ed2cb049eb069adb4d6e020d52d0443a (diff) |
Fix coverity issues (#16655)
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/log2journal/log2journal-replace.c | 2 | ||||
-rw-r--r-- | collectors/log2journal/log2journal-yaml.c | 2 |
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; |