aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/probe-event.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 8af8e7f55254..e2bf620f98cb 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -790,7 +790,11 @@ static int __show_line_range(struct line_range *lr, const char *module,
790 /* Convert source file path */ 790 /* Convert source file path */
791 tmp = lr->path; 791 tmp = lr->path;
792 ret = get_real_path(tmp, lr->comp_dir, &lr->path); 792 ret = get_real_path(tmp, lr->comp_dir, &lr->path);
793 free(tmp); /* Free old path */ 793
794 /* Free old path when new path is assigned */
795 if (tmp != lr->path)
796 free(tmp);
797
794 if (ret < 0) { 798 if (ret < 0) {
795 pr_warning("Failed to find source file path.\n"); 799 pr_warning("Failed to find source file path.\n");
796 return ret; 800 return ret;