File 0030-fix-empty-mem-pool-leak.patch of Package lvm2

From c43f2f8ae08ed0555a300764c8644ea56f4f41e2 Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Thu, 3 Jun 2021 14:44:55 -0500
Subject: [PATCH 30/33] fix empty mem pool leak

of "config" when LVM_SYSTEM_DIR=""

Signed-off-by: Heming Zhao <heming.zhao@suse.com>
---
 lib/commands/toolcontext.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 296618686f7b..e2be89d0f480 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);
-- 
1.8.3.1
openSUSE Build Service is sponsored by