summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2023-04-12 15:23:35 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-04-12 15:23:35 +0200
commit57f14b5ae1a97537f2abd2828ee7212cada7036e (patch)
tree29dda38366b4bb6074f0d8c7cfa5a6932e3f1142
parentperf metricgroups: Use zfree() to reduce chances of use after free (diff)
downloadlinux-57f14b5ae1a97537f2abd2828ee7212cada7036e.tar.xz
linux-57f14b5ae1a97537f2abd2828ee7212cada7036e.zip
perf pmu: zfree() expects a pointer to a pointer to zero it after freeing its contents
An audit showed just this one problem with zfree(), fix it. Fixes: 9fbc61f832ebf432 ("perf pmu: Add support for PMU capabilities") Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/pmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
index 01533302d5f9..561e2616861f 100644
--- a/tools/perf/util/pmu.c
+++ b/tools/perf/util/pmu.c
@@ -1852,7 +1852,7 @@ static int perf_pmu__new_caps(struct list_head *list, char *name, char *value)
return 0;
free_name:
- zfree(caps->name);
+ zfree(&caps->name);
free_caps:
free(caps);