From: Steven Rostedt <rostedt@goodmis.org>
To: Linux Trace Devel <linux-trace-devel@vger.kernel.org>
Subject: [PATCH] libtraceevent: Free "->" token in process_entry()
Date: Wed, 23 Jun 2021 22:47:30 -0400 [thread overview]
Message-ID: <20210623224730.6af93f6c@rorschach.local.home> (raw)
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Fixing an issue with parsing "(REC)->" when it expected "REC->", changed
the test of "->" to read into a "token" variable instead of just
"expecting" it. This was needed to test for the ")" case. But since it is
now read into a token, that token needs to be freed. But that was missed.
Free the token.
This was found by the libtracefs "make test_mem" tests.
Fixes: 62823da1 ("libtraceevent: Handle parsing of "(REC)->" case")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
src/event-parse.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/event-parse.c b/src/event-parse.c
index 94e2b90..de28b3b 100644
--- a/src/event-parse.c
+++ b/src/event-parse.c
@@ -2325,6 +2325,8 @@ process_entry(struct tep_event *event __maybe_unused, struct tep_print_arg *arg,
if (test_type_token(type, token, TEP_EVENT_OP, "->"))
goto out_free;
+ free_token(token);
+
if (read_expect_type(TEP_EVENT_ITEM, &token) < 0)
goto out_free;
field = token;
--
2.29.2
reply other threads:[~2021-06-24 2:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210623224730.6af93f6c@rorschach.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).