summaryrefslogtreecommitdiff
path: root/tools/lib
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2012-10-01 20:23:28 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-10-16 13:07:05 -0300
commit743df75ff10630f1f2a461f0f4b51f601f53ec44 (patch)
tree488d930073d83174f4244bed3deedac1acb04326 /tools/lib
parent101782ea2c6984cf169631c59df76b8497899caf (diff)
tools lib traceevent: Fix missed freeing of subargs in free_arg() in filter
Some of args were missed in free_args(), as well as subargs. That is args like FILTER_ARG_NUM have left and right pointers to other args that also need to be freed. Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: http://lkml.kernel.org/r/1349137408.22822.135.camel@gandalf.local.home Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/traceevent/parse-filter.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/lib/traceevent/parse-filter.c b/tools/lib/traceevent/parse-filter.c
index ad17855528f9..5ea4326ad11f 100644
--- a/tools/lib/traceevent/parse-filter.c
+++ b/tools/lib/traceevent/parse-filter.c
@@ -209,7 +209,16 @@ static void free_arg(struct filter_arg *arg)
switch (arg->type) {
case FILTER_ARG_NONE:
case FILTER_ARG_BOOLEAN:
+ break;
+
case FILTER_ARG_NUM:
+ free_arg(arg->num.left);
+ free_arg(arg->num.right);
+ break;
+
+ case FILTER_ARG_EXP:
+ free_arg(arg->exp.left);
+ free_arg(arg->exp.right);
break;
case FILTER_ARG_STR:
@@ -218,6 +227,12 @@ static void free_arg(struct filter_arg *arg)
free(arg->str.buffer);
break;
+ case FILTER_ARG_VALUE:
+ if (arg->value.type == FILTER_STRING ||
+ arg->value.type == FILTER_CHAR)
+ free(arg->value.str);
+ break;
+
case FILTER_ARG_OP:
free_arg(arg->op.left);
free_arg(arg->op.right);