Fix an itty-bitty QoS-related memory leak 95/240895/3
authorMateusz Majewski <m.majewski2@samsung.com>
Wed, 12 Aug 2020 12:21:04 +0000 (14:21 +0200)
committerMichal Bloch <m.bloch@partner.samsung.com>
Wed, 12 Aug 2020 13:07:37 +0000 (13:07 +0000)
Change-Id: I5b5a487bbdc186fc63286f70df4b2ac0e28af622

src/logger/logger.c

index 078d694..c4cde81 100644 (file)
@@ -2258,6 +2258,7 @@ static int logger_create(struct logger_config_data *data, struct logger *l)
        l->qos.threshold_reapply = data->qos_threshold_reapply;
        l->qos.limit_duration = data->qos_limit_duration;
        l->qos.file_path = data->qos_file_path;
+       data->qos_file_path = NULL;
 
        if (g_backend.use_logger_by_default)
                for (log_id_t id = 0; id < LOG_ID_MAX; ++id) {
@@ -2756,6 +2757,7 @@ static void free_config_data(struct logger_config_data *data)
 {
        list_remove_if(&data->logfile_configs, NULL, cond_string_free);
        free(data->dynamic_config_dir);
+       free(data->qos_file_path);
 }
 
 /**