From: tip-bot for Rickard Strandqvist <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
rickard_strandqvist@spectrumdigital.se, hpa@zytor.com,
mingo@kernel.org, jolsa@kernel.org, tglx@linutronix.de,
namhyung@kernel.org
Subject: [tip:perf/core] tools lib traceevent: Fix a risk for doing free on uninitialized pointer
Date: Sat, 5 Jul 2014 03:41:52 -0700 [thread overview]
Message-ID: <tip-21da83fb6c3ff67e969b8770bbb33138c9ede88e@git.kernel.org> (raw)
In-Reply-To: <1403608150-13037-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
Commit-ID: 21da83fb6c3ff67e969b8770bbb33138c9ede88e
Gitweb: http://git.kernel.org/tip/21da83fb6c3ff67e969b8770bbb33138c9ede88e
Author: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
AuthorDate: Tue, 24 Jun 2014 13:09:10 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Fri, 27 Jun 2014 11:14:47 +0200
tools lib traceevent: Fix a risk for doing free on uninitialized pointer
Fix a risk of doing free on an uninitialized pointer.
This was found using a static code analysis program called cppcheck.
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Link: http://lkml.kernel.org/r/1403608150-13037-1-git-send-email-rickard_strandqvist@spectrumdigital.se
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/lib/traceevent/event-parse.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 93825a1..cf3a44b 100644
--- a/tools/lib/traceevent/event-parse.c
+++ b/tools/lib/traceevent/event-parse.c
@@ -2395,7 +2395,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok)
{
struct print_arg *field;
enum event_type type;
- char *token;
+ char *token = NULL;
memset(arg, 0, sizeof(*arg));
arg->type = PRINT_FLAGS;
@@ -2448,7 +2448,7 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok)
{
struct print_arg *field;
enum event_type type;
- char *token;
+ char *token = NULL;
memset(arg, 0, sizeof(*arg));
arg->type = PRINT_SYMBOL;
@@ -2487,7 +2487,7 @@ process_hex(struct event_format *event, struct print_arg *arg, char **tok)
{
struct print_arg *field;
enum event_type type;
- char *token;
+ char *token = NULL;
memset(arg, 0, sizeof(*arg));
arg->type = PRINT_HEX;
prev parent reply other threads:[~2014-07-05 10:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 11:09 [PATCH] tools: lib: traceevent: event-parse.c: Fix a risk for doing free on uninitialized pointer Rickard Strandqvist
2014-06-25 1:04 ` Namhyung Kim
2014-06-25 7:33 ` Jiri Olsa
2014-07-05 10:41 ` tip-bot for Rickard Strandqvist [this message]
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=tip-21da83fb6c3ff67e969b8770bbb33138c9ede88e@git.kernel.org \
--to=tipbot@zytor.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=tglx@linutronix.de \
/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