projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
perf metric: Fix memory leak in expr__add_id function
[linux-2.6-microblaze.git]
/
tools
/
perf
/
util
/
expr.c
diff --git
a/tools/perf/util/expr.c
b/tools/perf/util/expr.c
index
5d05f97
..
578a173
100644
(file)
--- a/
tools/perf/util/expr.c
+++ b/
tools/perf/util/expr.c
@@
-47,6
+47,8
@@
int expr__add_id_val(struct expr_parse_ctx *ctx, const char *id, double val)
}
ret = hashmap__set(&ctx->ids, id, data_ptr,
(const void **)&old_key, (void **)&old_data);
+ if (ret)
+ free(data_ptr);
free(old_key);
free(old_data);
return ret;