All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
	Jiri Olsa <jolsa@kernel.org>
Subject: [PATCH 1/5] tools lib traceevent: Fix a risk for doing free on uninitialized pointer
Date: Fri, 27 Jun 2014 14:20:57 +0200	[thread overview]
Message-ID: <1403871661-18474-2-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1403871661-18474-1-git-send-email-jolsa@kernel.org>

From: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>

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;
-- 
1.8.3.1


  reply	other threads:[~2014-06-27 12:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-27 12:20 [GIT PULL 0/5] perf/core improvements and fixes Jiri Olsa
2014-06-27 12:20 ` Jiri Olsa [this message]
2014-06-27 12:20 ` [PATCH 2/5] perf tools powerpc: Adjust callchain based on DWARF debug info Jiri Olsa
2014-06-27 12:20 ` [PATCH 3/5] perf tools: Fix wrong condition for allocation failure Jiri Olsa
2014-06-27 14:12   ` Arnaldo Carvalho de Melo
2014-06-27 12:21 ` [PATCH 4/5] perf script: Move the number processing into its own function Jiri Olsa
2014-06-27 12:21 ` [PATCH 5/5] perf script: Handle the num array type in python properly Jiri Olsa
2014-07-05  9:30 ` [GIT PULL 0/5] perf/core improvements and fixes Ingo Molnar

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=1403871661-18474-2-git-send-email-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rickard_strandqvist@spectrumdigital.se \
    /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.