aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-05-24 21:24:06 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-05-24 21:35:36 -0400
commit4eb962abae4753b1ab43590ebd355753677cdd86 (patch)
tree75fb9771ee143ee184fb6d84db1aa4a589d500b4
parentfca5d5687c29b1214d20067691a6c64965e82c10 (diff)
trace-cmd: Copy field name in old string processing
In processing old print-fmt's (and also when the print format does not contain args), the arg field name points directly to the field name. But on at the end it will free the field name twice. One for the arg and one for the field. The name needs to be strdup(). Reported-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--parse-events.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse-events.c b/parse-events.c
index e48900a..cac5ed3 100644
--- a/parse-events.c
+++ b/parse-events.c
@@ -4327,7 +4327,7 @@ int pevent_parse_event(struct pevent *pevent,
4327 *list = arg; 4327 *list = arg;
4328 list = &arg->next; 4328 list = &arg->next;
4329 arg->type = PRINT_FIELD; 4329 arg->type = PRINT_FIELD;
4330 arg->field.name = field->name; 4330 arg->field.name = strdup(field->name);
4331 arg->field.field = field; 4331 arg->field.field = field;
4332 } 4332 }
4333 return 0; 4333 return 0;