1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-06 17:18:29 +03:00

Fix memory leak of config_tree

Adding missing destroy_config_tree() for cft_override if it has been allocated.
This commit is contained in:
Zdenek Kabelac 2010-09-30 11:44:54 +00:00
parent 1ebbfd9958
commit 3d7e8602ed
2 changed files with 5 additions and 0 deletions

View File

@ -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.

View 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;
}