]> sourceware.org Git - lvm2.git/commitdiff
Fix memory leak of config_tree
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 30 Sep 2010 11:44:54 +0000 (11:44 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 30 Sep 2010 11:44:54 +0000 (11:44 +0000)
Adding missing destroy_config_tree() for cft_override if it has been allocated.

WHATS_NEW
tools/lvmcmdline.c

index ca460a7a1d34cf061559e79357b78fcf14fc3981..4dde8a57ccd8f840a6fe57be1cce823791f009cc 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.75 - 
 =====================================
+  Fix memory leak of config_tree in reinitialization code path.
   Swap pool destruction order in dmeventd_lvm2_exit() to fix leak report.
   Read whole /proc/self/maps file before working with maps entries.
   Speed up unquoting of quoted double quotes and backslashes.
index 6c66fab6f5539a69ff0717232e6333376299f2b3..b29acfbb2d603ff62dda771de07bf76010836a62 100644 (file)
@@ -1048,6 +1048,10 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
        if (arg_count(cmd, config_ARG) || !cmd->config_valid || config_files_changed(cmd)) {
                /* Reinitialise various settings inc. logging, filters */
                if (!refresh_toolcontext(cmd)) {
+                       if (cmd->cft_override) {
+                               destroy_config_tree(cmd->cft_override);
+                               cmd->cft_override = NULL;
+                       }
                        log_error("Updated config file invalid. Aborting.");
                        return ECMD_FAILED;
                }
This page took 0.047171 seconds and 5 git commands to generate.