diff options
author | Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com> | 2023-10-24 13:58:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-24 13:58:35 +0300 |
commit | eff9bd8b52c21d01b0e75cd6945dd306a068e4c0 (patch) | |
tree | 115a996aaf1e4d77dc97389d7fc5cd37606102e7 /collectors | |
parent | 81138f77d275e592e210999e68bac97282b1d740 (diff) |
Fix coverity issue 403725 (#16265)
CID 403725: Resource leaks (RESOURCE_LEAK)
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/systemd-journal.plugin/systemd-journal.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/collectors/systemd-journal.plugin/systemd-journal.c b/collectors/systemd-journal.plugin/systemd-journal.c index fc20f3009e..bdcdac4bfd 100644 --- a/collectors/systemd-journal.plugin/systemd-journal.c +++ b/collectors/systemd-journal.plugin/systemd-journal.c @@ -2419,8 +2419,10 @@ static void function_systemd_journal(const char *transaction, char *function, in value = sep; } - if(buffer_strlen(sources_list)) + if(buffer_strlen(sources_list)) { + simple_pattern_free(sources); sources = simple_pattern_create(buffer_tostring(sources_list), ",", SIMPLE_PATTERN_EXACT, false); + } buffer_free(sources_list); |