@cryptotaxi247 / netdata-1 / commits / eff9bd8b5

Fix coverity issue 403725 (#16265)

CID 403725: Resource leaks (RESOURCE_LEAK)

Stelios Fragkakis committed Oct 24, 2023 at 13:58 UTC eff9bd8b52c21d01b0e75cd6945dd306a068e4c0
1 file changed +3 -1
collectors/systemd-journal.plugin/systemd-journal.c
+3 -1
@@ -2419,8 +2419,10 @@ static void function_systemd_journal(const char *transaction, char *function, in
2419 value = sep;
2420 }
2421
2422 - if(buffer_strlen(sources_list))
2422 + if(buffer_strlen(sources_list)) {
2423 + simple_pattern_free(sources);
2424 sources = simple_pattern_create(buffer_tostring(sources_list), ",", SIMPLE_PATTERN_EXACT, false);
2425 + }
2426
2427 buffer_free(sources_list);
2428