summaryrefslogtreecommitdiff
path: root/lib/commands
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2021-06-03 14:44:55 -0500
committerDavid Teigland <teigland@redhat.com>2021-06-03 14:46:33 -0500
commitc43f2f8ae08ed0555a300764c8644ea56f4f41e2 (patch)
tree0cf3014474afa7250e60663d4ae0d3df81f23d71 /lib/commands
parentfe05828e7e4c78a1ed4430ce4057c785d0b898a0 (diff)
downloadlvm2-c43f2f8ae08ed0555a300764c8644ea56f4f41e2.tar.gz
fix empty mem pool leak
of "config" when LVM_SYSTEM_DIR=""
Diffstat (limited to 'lib/commands')
-rw-r--r--lib/commands/toolcontext.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 296618686..e2be89d0f 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -966,8 +966,8 @@ static void _destroy_config(struct cmd_context *cmd)
/* CONFIG_FILE/CONFIG_MERGED_FILES */
if ((cft = remove_config_tree_by_source(cmd, CONFIG_MERGED_FILES)))
config_destroy(cft);
- else
- remove_config_tree_by_source(cmd, CONFIG_FILE);
+ else if ((cft = remove_config_tree_by_source(cmd, CONFIG_FILE)))
+ config_destroy(cft);
dm_list_iterate_items(cfl, &cmd->config_files)
config_destroy(cfl->cft);