From: Milan Broz <mbroz@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] fix cmd->cmd_line memory pool use
Date: Thu, 02 Apr 2009 16:19:47 +0200 [thread overview]
Message-ID: <49D4C983.1070002@redhat.com> (raw)
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;
}
next reply other threads:[~2009-04-02 14:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-02 14:19 Milan Broz [this message]
2009-04-02 14:36 ` [PATCH] fix cmd->cmd_line memory pool use Alasdair G Kergon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49D4C983.1070002@redhat.com \
--to=mbroz@redhat.com \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.