Skip to content

Commit

Permalink
tools lib traceevent: Fix a risk for doing free on uninitialized pointer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rickard Strandqvist authored and Jiri Olsa committed Jun 27, 2014
1 parent 1c92f88 commit 21da83f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/lib/traceevent/event-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 21da83f

Please sign in to comment.