OSDN Git Service

perf pmu: Use zfree() to reduce chances of use after free
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 12 Apr 2023 12:50:08 +0000 (09:50 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 12 Apr 2023 13:02:26 +0000 (10:02 -0300)
commitefe98a7a39777ce266142159f303fb52c3b817c0
tree6437f90f6114102162acf467c6b2bbdc2f11a0a9
parent9fbde6c8002bce61acd0c2187cc41c43a7c99968
perf pmu: Use zfree() to reduce chances of use after free

Do defensive programming by using zfree() to initialize freed pointers
to NULL, so that eventual use after free result in a NULL pointer deref
instead of more subtle behaviour.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/pmu.c