From: Steven Rostedt <rostedt@goodmis.org>
To: Totoro W <tw19881113@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH] fix double free issue in event_read_print_args
Date: Fri, 28 Jun 2024 11:34:56 -0400 [thread overview]
Message-ID: <20240628113456.730030af@rorschach.local.home> (raw)
In-Reply-To: <CAFrM9zvV9oHvCpVmt3un-wMFJFoyXq7SOWTOENpDGrn_HQQDDQ@mail.gmail.com>
On Fri, 28 Jun 2024 09:51:10 +0800
Totoro W <tw19881113@gmail.com> wrote:
> Oops, missing the patch part, here it is:
Could you send a v2 with all the contents.
Thanks,
-- Steve
>
> diff --git a/src/event-parse.c b/src/event-parse.c
> index 9f0522c..1f51ee9 100644
> --- a/src/event-parse.c
> +++ b/src/event-parse.c
> @@ -2375,8 +2375,6 @@ process_op(struct tep_event *event, struct
> tep_print_arg *arg, char **tok)
>
> /* it will set arg->op.right */
> type = process_cond(event, arg, tok);
> - if (type == TEP_EVENT_ERROR)
> - free(token);
>
> } else if (strcmp(token, ">>") == 0 ||
> strcmp(token, "<<") == 0 ||
> @@ -3787,7 +3785,7 @@ static int event_read_print_args(struct
> tep_event *event, struct tep_print_arg *
> {
> enum tep_event_type type = TEP_EVENT_ERROR;
> struct tep_print_arg *arg;
> - char *token;
> + char *token = NULL;
> int args = 0;
>
> do {
> @@ -3817,6 +3815,7 @@ static int event_read_print_args(struct
> tep_event *event, struct tep_print_arg *
> if (type == TEP_EVENT_OP) {
> type = process_op(event, arg, &token);
> free_token(token);
> + token = NULL;
>
> if (consolidate_op_arg(arg) < 0)
> type = TEP_EVENT_ERROR;
next prev parent reply other threads:[~2024-06-28 15:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 1:51 [PATCH] fix double free issue in event_read_print_args Totoro W
2024-06-28 15:34 ` Steven Rostedt [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-06-27 6:51 Totoro W
2024-06-28 15:35 ` 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=20240628113456.730030af@rorschach.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=tw19881113@gmail.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.