All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix leaked config override mempool.
@ 2009-07-15 13:22 Milan Broz
  0 siblings, 0 replies; only message in thread
From: Milan Broz @ 2009-07-15 13:22 UTC (permalink / raw)
  To: lvm-devel

Fix leaked config override mempool.

pvs --config 'global { units = "<" }'
  Invalid units specification
  Updated config file invalid. Aborting.

causes in old code
    Segmentation fault
and now memory leak :-)

Fix it by properly releasing overrided config in lvm_run_command
if refresh_toolcontext() fails.

Signed-off-by: Milan Broz <mbroz@redhat.com>
---
 tools/lvmcmdline.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 10cbb12..f756a0f 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -993,7 +993,8 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
 		/* Reinitialise various settings inc. logging, filters */
 		if (!refresh_toolcontext(cmd)) {
 			log_error("Updated config file invalid. Aborting.");
-			return ECMD_FAILED;
+			ret =  ECMD_FAILED;
+			goto out;
 		}
 	}
 




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-07-15 13:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-15 13:22 [PATCH] Fix leaked config override mempool Milan Broz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.