diff options
| -rw-r--r-- | tools/perf/util/annotate.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index d5da1b85541b..01bc4e23a2cf 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
| @@ -177,6 +177,8 @@ static int lock__parse(struct ins_operands *ops) | |||
| 177 | goto out_free_ops; | 177 | goto out_free_ops; |
| 178 | 178 | ||
| 179 | ops->locked.ins = ins__find(name); | 179 | ops->locked.ins = ins__find(name); |
| 180 | free(name); | ||
| 181 | |||
| 180 | if (ops->locked.ins == NULL) | 182 | if (ops->locked.ins == NULL) |
| 181 | goto out_free_ops; | 183 | goto out_free_ops; |
| 182 | 184 | ||
| @@ -209,6 +211,13 @@ static int lock__scnprintf(struct ins *ins, char *bf, size_t size, | |||
| 209 | 211 | ||
| 210 | static void lock__delete(struct ins_operands *ops) | 212 | static void lock__delete(struct ins_operands *ops) |
| 211 | { | 213 | { |
| 214 | struct ins *ins = ops->locked.ins; | ||
| 215 | |||
| 216 | if (ins && ins->ops->free) | ||
| 217 | ins->ops->free(ops->locked.ops); | ||
| 218 | else | ||
| 219 | ins__delete(ops->locked.ops); | ||
| 220 | |||
| 212 | zfree(&ops->locked.ops); | 221 | zfree(&ops->locked.ops); |
| 213 | zfree(&ops->target.raw); | 222 | zfree(&ops->target.raw); |
| 214 | zfree(&ops->target.name); | 223 | zfree(&ops->target.name); |
