提交 21da83fb 编写于 作者: R Rickard Strandqvist 提交者: Jiri Olsa

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: NNamhyung Kim <namhyung@kernel.org>
Signed-off-by: NRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Link: http://lkml.kernel.org/r/1403608150-13037-1-git-send-email-rickard_strandqvist@spectrumdigital.seSigned-off-by: NJiri Olsa <jolsa@kernel.org>
上级 1c92f885
...@@ -2395,7 +2395,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok) ...@@ -2395,7 +2395,7 @@ process_flags(struct event_format *event, struct print_arg *arg, char **tok)
{ {
struct print_arg *field; struct print_arg *field;
enum event_type type; enum event_type type;
char *token; char *token = NULL;
memset(arg, 0, sizeof(*arg)); memset(arg, 0, sizeof(*arg));
arg->type = PRINT_FLAGS; arg->type = PRINT_FLAGS;
...@@ -2448,7 +2448,7 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok) ...@@ -2448,7 +2448,7 @@ process_symbols(struct event_format *event, struct print_arg *arg, char **tok)
{ {
struct print_arg *field; struct print_arg *field;
enum event_type type; enum event_type type;
char *token; char *token = NULL;
memset(arg, 0, sizeof(*arg)); memset(arg, 0, sizeof(*arg));
arg->type = PRINT_SYMBOL; arg->type = PRINT_SYMBOL;
...@@ -2487,7 +2487,7 @@ process_hex(struct event_format *event, struct print_arg *arg, char **tok) ...@@ -2487,7 +2487,7 @@ process_hex(struct event_format *event, struct print_arg *arg, char **tok)
{ {
struct print_arg *field; struct print_arg *field;
enum event_type type; enum event_type type;
char *token; char *token = NULL;
memset(arg, 0, sizeof(*arg)); memset(arg, 0, sizeof(*arg));
arg->type = PRINT_HEX; arg->type = PRINT_HEX;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册