diff options
author | Markos Fountoulakis <44345837+mfundul@users.noreply.github.com> | 2021-01-13 17:34:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-13 17:34:53 +0200 |
commit | 8ce96cdefc7fb443a87f8bc03548afd1fe1df7f4 (patch) | |
tree | 185a1efa6bbc66a868e8bbc47064a23e8fb0a911 /database | |
parent | 7f002c126d41c434df422804941bb254f13a913f (diff) |
Fix heap-use-after-free due to the chart using netdata_config memory for some strings. (#10498)
Diffstat (limited to 'database')
-rw-r--r-- | database/rrdset.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/database/rrdset.c b/database/rrdset.c index 959e9a3da8..163fbb0715 100644 --- a/database/rrdset.c +++ b/database/rrdset.c @@ -331,11 +331,6 @@ void rrdset_free(RRDSET *st) { rrdset_index_del_name(host, st); // ------------------------------------------------------------------------ - // remove it from the configuration - - appconfig_section_destroy_non_loaded(&netdata_config, st->config_section); - - // ------------------------------------------------------------------------ // free its children structures freez(st->exporting_flags); @@ -354,6 +349,11 @@ void rrdset_free(RRDSET *st) { rrdvar_free_remaining_variables(host, &st->rrdvar_root_index); // ------------------------------------------------------------------------ + // remove it from the configuration + + appconfig_section_destroy_non_loaded(&netdata_config, st->config_section); + + // ------------------------------------------------------------------------ // unlink it from the host if(st == host->rrdset_root) { |