All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix cmd->cmd_line memory pool use
@ 2009-04-02 14:19 Milan Broz
  2009-04-02 14:36 ` Alasdair G Kergon
  0 siblings, 1 reply; 2+ messages in thread
From: Milan Broz @ 2009-04-02 14:19 UTC (permalink / raw)
  To: lvm-devel

Do not use pointer from released memory pool (cmd->cmd_line).

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

diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index a96ef3c..bedf9e2 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1026,16 +1026,16 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
 	cmd->current_settings = cmd->default_settings;
 	_apply_settings(cmd);
 
-	/*
-	 * free off any memory the command used.
-	 */
-	dm_pool_empty(cmd->mem);
-
 	if (ret == EINVALID_CMD_LINE && !_cmdline.interactive)
 		_short_usage(cmd->command->name);
 
 	log_debug("Completed: %s", cmd->cmd_line);
 
+	/*
+	 * free off any memory the command used.
+	 */
+	dm_pool_empty(cmd->mem);
+
 	return ret;
 }
 




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-02 14:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-02 14:19 [PATCH] fix cmd->cmd_line memory pool use Milan Broz
2009-04-02 14:36 ` Alasdair G Kergon

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.