summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>2014-06-24 13:09:10 +0200
committerJiri Olsa <jolsa@kernel.org>2014-06-27 11:14:47 +0200
commit21da83fb6c3ff67e969b8770bbb33138c9ede88e (patch)
treed5f8c2b416aacc50ef7094a65059c56195ca8c60 /tools/lib
parent1c92f88542faa3ae4f970c548b4fe8275a45201b (diff)
downloadtalos-obmc-linux-21da83fb6c3ff67e969b8770bbb33138c9ede88e.tar.gz
talos-obmc-linux-21da83fb6c3ff67e969b8770bbb33138c9ede88e.zip
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>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/traceevent/event-parse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lib/traceevent/event-parse.c b/tools/lib/traceevent/event-parse.c
index 93825a17dcce..cf3a44bf1ec3 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;
OpenPOWER on IntegriCloud