From: Namhyung Kim <namhyung@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Arnaldo Carvalho de Melo <acme@infradead.org>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] tools lib traceevent: Fix missed freeing of subargs in free_arg() in filter
Date: Mon, 01 Oct 2012 22:16:35 +0900 [thread overview]
Message-ID: <1349097395.1613.4.camel@leonhard> (raw)
In-Reply-To: <1348874483.22822.100.camel@gandalf.local.home>
Hi Steve,
2012-09-28 (금), 19:21 -0400, Steven Rostedt:
> Some of args were missed in free_args(), as well as subargs.
> That is args like FILTER_ARG_NUM have left and right pointers to
> other args that also need to be freed.
>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
> tools/lib/traceevent/parse-filter.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
> index ad17855..2d907cb 100644
> --- a/tools/lib/traceevent/parse-filter.c
> +++ b/tools/lib/traceevent/parse-filter.c
> @@ -209,7 +209,12 @@ static void free_arg(struct filter_arg *arg)
> switch (arg->type) {
> case FILTER_ARG_NONE:
> case FILTER_ARG_BOOLEAN:
> + break;
> +
> case FILTER_ARG_NUM:
> + case FILTER_ARG_EXP:
> + free_arg(arg->op.left);
> + free_arg(arg->op.right);
Although they have same layout, wouldn't it be better using their own
fields?
case FILTER_ARG_NUM:
free_arg(arg->num.left);
free_arg(arg->num.right);
break;
case FILTER_ARG_EXP:
free_arg(arg->exp.left);
free_arg(arg->exp.right);
break;
Thanks,
Namhyung
next prev parent reply other threads:[~2012-10-01 13:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 23:21 Steven Rostedt
2012-10-01 13:16 ` Namhyung Kim [this message]
2012-10-01 13:42 ` Steven Rostedt
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=1349097395.1613.4.camel@leonhard \
--to=namhyung@kernel.org \
--cc=acme@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®